Categories
blogging Perl

Coder as Translator, or the glory that was Perl

Right now most of my work is in Python. It’s a neat language, but not as fun as Ruby is IMHO. I don’t want to get into a flame war. I prefer Ruby, often say it to someone with a math or data science background, get some eye rolling, and then say, “I work in Python.”

During the 1990s and early 2000s, one language reined supreme as the “Duct Tape of the Internet,” Perl. There are so many reasons Perl isn’t used today. One has to do with its philosophy, TIMTOWTDI. “There Is More Than One Way To Do It.” Such a philosophy, works with language, and is even encouraged in poetry where a poet is asked to use metaphors and similes to poetize. However, today, it is one of the central dogmas of computer science that the most efficient algorithm is the best algorithm. A merge sort is always to be preferred over a quick sort because a quick sort is slower in the case of almost-sorted data. God forbid you suggest an insertion sort!

Why would a programming language encourage inefficiency in algorithm design? The answer to this is a good and empowering one. Larry Wall, the creator of Perl, saw Moore’s Law as creating cheaper and quicker computing power every year, such that during the 1990s, it felt like there was a surplus of computing power. If a query took 9 seconds instead of 3 seconds because the algorithm was exponentially inefficient that was ok, because the main point was:

Great technology empowers everyone.

Larry Wall saw his creation literally as a human language which can be spoken by 5 year olds or Shakespearean actors. The range of expression is what allows natural language and by extension Perl to do so much.

My first paid programming job was in Perl. It involved making changes to a web form for a dentist website. Easy stuff, and it was great getting paid and being able to point to my work online. This dentist and his website have long since retired.

My first project where I saw the magic of Perl had to do with parsing random documents for mailing addresses to create a holiday mailing list. Parsing text is where Perl really shines through. The secretary cried tears of joy when she found out her task could all be done automatically.

My second project where once again Perl proved itself to be a workhorse that made impossible tasks possible had to do with updating spreadsheets for different managers tracking photographs for the NBC Olympics Website. The Perl code would check the state of the photographs from request to publishing, and update spreadsheets accordingly. Yeah, this sounds like a stupid process, but we still haven’t gotten rid of stupid processes to this day.

Much of the work felt like translation from human, natural language to what felt like Perl’s natural language. Today, someone speaking Perl learnt out in the wild wouldn’t really pass any of the tech interviews where there’s only one way to do it.

As time went on folks saw that Perl only empowered individual programmers. Much of the Perl that has been written is unreadable, since everyone makes up their own dialect, and tries to be as terse as possible in the many ways that you can be. Inheriting a Perl project can be a nightmare unless it’s properly documented (more so than say an inherited Ruby project). Also, today, Internet Duct Tape is an anti-pattern. No more using Perl or language of your choice to be a hero and integrate 2 disparate systems on the fly. But for a nice stretch of time, one coder could make a difference through the glory that was Perl.

I still do stuff with Perl like this to check if Twitter is down:

lynx -source https://twitter.com | perl -ne ‘print “$1 on Twitter\n” if /(Something is technically wrong)./’

Leave a Reply

Your email address will not be published. Required fields are marked *