Tag Archives: Perl

Eight Python warts

I love Python, but a few things still bug me about it. I’ve bashed on several other technologies; here’s some Python bashing. In no particular order:

Update: This has started a pretty good discussion on Reddit. Many people correctly guessed that I’m using singleton in the mathematical sense, not in the sense of the programming pattern. The comments from Cairnarvon and tghw are particularly worth reading.

If programming were like building a house…

I’m always coming up with metaphors to explain to non-technical people what I do. The point of this one was to explain to people why I prefer Python:

  • Programming in C is like building a four-story mansion out of 1×2 Lego bricks.
  • Programming in Python is like building a house out of Lego Technic parts.
  • Programming in Perl is like building a house with duct tape, a flat of cinder-blocks, some left-over lumber, pipe cleaners, crazy glue, fishing line, and chicken wire. You also get a bunch of re-bar that you can bend into whatever shape you want, and truck full of spray-on concrete.
  • Programming in PHP is like building a house with just chicken wire, coat hangers, and aluminum foil. Luckily, if you use enough aluminum foil, it will shield your brain from the alien transmissions from outer space, so you don’t have to wear your aluminum foil hat while you’re at home.
  • Programming in Java is like buying a one-piece, hyper-modern, injection-molded plastic house unit, and then having your lawyer write a letter to the house manufacturer asking for permission to cut a one-meter by two-meter hole in the living room wall into which you’ll install the front door, since the house doesn’t come with one. Your lawyer promises in the letter not to sue the house manufacturer for problems with the door.
  • Programming in Ruby1 is like building a house out of two different brands of cheap knock-off Legos, made of flimsy, low-quality plastic, which don’t fit together quite snugly enough. You also get a handful of puke-green pipe-cleaners left over from Perl.
  • Programming in JavaScript is like building a house out of Jell-O that has to stand up on three different lots, one flat, one downhill, and one uphill. Just when you’re finished building the house, Bill Cosby rides up on a stallion, ready to start filming a Jell-O commercial.
  • Programming in XSLT is like hiring an architect who speaks only Icelandic, an engineer who speaks only Bantu, and a bunch of Nepalese sherpas as the construction team. The architect thinks you’re building a supermarket, and the engineer thinks you’re inventing a new kind of refrigerator, and the sherpas think you’re doing performance art. The engineer builds a catapult to fling 2x4s into the air while the sherpas fire high-powered nail-guns at them, and when it’s all done you’ve got an ordinary two bedroom suburban house that’s completely upside-down.

That’s all! Happy April Fools!

  1. I’ll be posting a larger article about my recent experiences learning Ruby in a few days. Subscribe here if you want to read it when it’s posted. []

Revolutionary and wrong

What Larry Wall is doing (or has been doing, for the last seven years) with Perl 6 is revolutionary:

There needs to be a universal root language, and ways of warping that universal root language into whatever dialect you like.

It’s incredibly valuable to examine all the ways in which a (programming or natural) language can vary. I’m sure they’re learning a lot that will be useful to language designers everywhere. Perl 6 will undoubtedly be a great tool for quickly prototyping new languages, too.

It’s also wrong for a production language. The last thing I want in a programming language is diversely variable and configurable syntax and semantics. Sitting down to maintain or debug someone else’s Perl 6 sounds like a nightmare. Not only would you have to figure out what they are trying to say, you’d have to figure out what dialect of Perl 6 they were using, and exactly how that dialect works.

For this reason I’d tend to avoid Perl 6 for new projects, nor would I want to join a Perl 6 project mid-stream. If I had to work in Perl 6, the first thing I’d do would be to convince the entire team to stick to the standard dialect (or maybe some other, popular dialect) and never re-configure it.

I doubt we’ll see much traction for Perl 6 outside of research settings. The benefit of picking PHP and Java over Python or Ruby is that it’s easier to find PHP and Java programmers, than it is to find programmers for even the relatively popular Python or Ruby. Trying to find a programmer who knows not just Perl but Perl 6 and your dialect of Perl 6 is going to be even harder.