Back to Perl

In my day job I spent a few hours today working in Perl. Having been using Ruby for over six years now I am quite familiar with how lacking Perl is in comparison. However, once again I was floored by how much less intuitive things are outside of Ruby. Even though Perl is a great language, having tasted from much better nectar makes it harder to appreciate those great strides Larry Wall made in the language.

What kind of things were not so intuitive? In my program today I had a situation where some questions need to be asked of the user. I wanted to use a DSL (domain specific language) to handle the querying because I need to create about a dozen similar programs that all do things just a bit differently. To facilitate this I abstracted as much common code as possible into its own class, threw it into a Perl module file, and made it available for all the programs to use.

However, Perl is not really capable of DSLs, and trying just made the code really messy. As it stands I have something that works but will need some revision next time I update it. Instead of a clean DSL I have a strange function-passing call-back situation that makes following the code more challenging than such a small program should be. In Ruby this thought would have led to clean code, but in Perl I need to revisit the code and rework it to a pure object-oriented design, sans psuedo-DSL, to effect more maintainable code. At the same time, without being able to think in terms of the DSL will make writing the dozen or so programs that are really the point of this whole exercise more difficult.

If you want to help save me from this situation in the future, go out there and help make Ruby more mainstream. I am only stuck using Perl because it comes with everything. It comes pre-installed with almost every Unix now, and often it comes packaged again with third-party applications. Ruby should be in many of these positions. Ruby comes with Mac OS X, but not much else. Until the day I hear Ruby comes pre-installed with Solaris I know that Ruby has not yet really broken into the mainstream—what Sun includes with Solaris is a good indication of what is in mainstream use.

So come on! Let us get out there and promote Ruby! Let us bring Ruby into the mainstream and make everyone’s lives easier!

  • You can skip to the end and leave a comments. Trackback is currently closed.
  • Trackback URI: http://cosine.org/2007/07/20/perl/trackback/
  • Comments RSS 2.0

Leave a Reply

You must be logged in to post a comment.