Quantcast
Channel: Elliott C. Back » Search Results » hashes
Viewing all articles
Browse latest Browse all 5

A few thoughts about perl

$
0
0

I started using perl the other day, and I noticed a few things about it:

1) Perl is really not typesafe, and really doesn’t even have types proper. In fact, the reason why you can’t use true/false is because in theory someone might mean true to be 47 and false to be 46. In reality, this is just a coverup to hide the fact that perl has no typesystem whatsoever.

2) Perl is a memory hog. Loading 120,000 small data values into hashes took up 200mb of ram. I’m not the first to notice this.

3) Perl syntax is ugly. $ for variables, % for hashes, @ for arrays, differing semantic context for # to get array length? It’s a big mess. Then there’s the regex syntax, where $var =~ a/regex/replace/ magically replaces things.

4) Perl functions are hacks. sub x {} doesn’t even define a parameter list, but just puts them all into a magic variable you can “shift” to get them out. What? Seriously! This is messy as anything, and means that the compiler can’t do certain kinds of optimizational analysis.

5) Why are the variables all global by default? Didn’t the inventors of perl hear about something called “default scope,” which in every other sane language is local?

However, there are lots of cool “glue” applications you can do with it, including bayesian chess: www.lbreyer.com/spam_chess.html . Also note that I don’t hate perl–it’s my second day using it.


Viewing all articles
Browse latest Browse all 5

Trending Articles