That’s my blog title and I’m sticking with it.

February 19, 2008

My wife, after reading my first post asked what the blog title “naughty bits” was all about. “What kind of a name is that for a blog?,” she asked, insinuating an audit of my browser history was imminent.

I pointed out that it was the “naughty bits” in one’s code that made it not work so well. Also, since I grew up with sitcoms like “Three’s Company” and reruns of Monty Python, the phrase “naughty bits” seemed so perfect.

Three’s Company was a comedy about two girls and a guy living in the same apartment. The guy, Jack, had to pretend to be gay so that the landlord would allow him to live in a mixed situation. Silly jokes and misunderstandings ensue. The phrase “double entendre” is introduced into the popular culture. Many years later, Susan Sommers, one of the stars of the show, makes a comeback selling “thighmaster” excercisers on late night T.V (even thigh master is a double entendre).

Here’s what wikipedia has to say about “Three’s Company”.

Naughty Bits, is also, of course, a double entendre.

Anyway, it’s too late to change the title. I don’t want to alienate my (2.3) readers, and I like it too much to change. We’re going to press with Naughty Bits.


Command line programs and perl Getopt::Long

February 19, 2008

In Today’s Post

I provide a simple template I use to start every command-line utility I write in Perl. We’ll also make command-line option parsing easy using Getopt::Long, as well as make encapsulated documentation using POD.

Perl, the Swiss Army Chainsaw

Perl is an excellent language for system scripting. There are those who criticize Perl for being “syntactically excessive.” However, as languages evolve expressive power they often become more complicated. Remaining backward compatible requires carrying around a certain amount of syntactic baggage.

I’m pragmatic in that I’d choose a language that was powerful with a few eccentricities over one that was perfect and less useful, or one that had stopped evolving. Languages are a living thing – they need to adapt to changes in the environment or they die.

Perl will always be alive and well because it’s just too damn useful. Larry Wall, the creator of Perl, has described his creation variously as “duct tape for the Web” and a “Swiss Army chainsaw”. Perl’s hallmark is flexibility, which is just what’s required to glue things together that weren’t necessarily designed to be glued together.

In a future post I’ll show you a style of Perl programming that works well for me and provides just the right amount of OOP without going overboard. This is actually simpler to do than you might think.

Read the rest of this entry »


And now for something completely different…

February 14, 2008

I’ve spent a fair deal of time hemming and hawing about writing a blog. As a “member of Generation X,” the idea of blogging is an awkward one. On the other hand, since the average blog has 2.3 readers, I can safely assume that both my brother and mother will forgive me if this blog fails to amuse them (they’ve forgiven so much already).

So here goes. What the heck is this blog about anyway?

I’ve always really enjoyed programming, in spite of the fact that I do an awful lot of it as a professional. A friend and I were talking about writing good code and he mentioned that if I “included good code” in a blog, that people would actually read it. Of course I was intrigued by this incredibly naive sounding idea and had to try it out.

If it turns out to be wrong, all 3.3 of us can have a good laugh and collectively blame Allen.