Why I Chose Perl To Rewrite Water Billing Programs

The water billing programs are a suite of three programs. One report is geared towards the water department; another is geared towards the Treasurer’s/Collector’s office; and a third updates the accounts and prints the bills. The first two reports’ totals have to agree, because they don’t change the accounts, but instead show how much will be billed.

These days, water bills are calculated by levels. We are going to three levels from the current two levels. Calculating  a bill is simple enough, but if the bill is adjusted, creating an adjusted bill that either increases or decreases the original bill (depending on the adjustment) is a little trickier. Currently this algorithm is written in Informix 4GL. Because we are changing how we bill the calculating and billing programs have to be more or less rewritten, and my feeling is why not chose another language.

I have been writing some new small applications in Clojure lately and have been maintaining Python and Django code I wrote three years ago. I really wanted to use Clojure for this project, but did not choose it, because currently there is no Informix DB interface, and I do not have time to write one. I did not choose Python, because even though it has a good Informix interface, the consultant we work with prefers Perl, and I have to say his code has been running quite well with few if any errors over the past few years.

I have written Perl code on and off over the past decade, so rewriting these programs shouldn’t be a problem. So, if you are wondering why I am writing this, it is because for no logical reason, it seems to me given the new generation of languages like Python, Scala, and Clojure, writing in Perl is like taking a step backwards, and I know that is not true. I am sometime mesmerized that we have all these programming languages, and they seem to go out of favor, and I’m not always sure why.

Is Perl as ubiquitous as I’ve heard? In my absence, will just about anyone be able to maintain the Perl code? For that matter, will someone be able to come in and read the Clojure code that has been written? It’s well commented, like our Perl code. These are just some thoughts as the project begins.

 

Advertisements

4 Comments

Filed under Programming

4 responses to “Why I Chose Perl To Rewrite Water Billing Programs

  1. Alex

    Hey Octopusgrabbus,

    I guess you’ve re discovered why the R is in Perl 🙂

    Note however when you would like some performance relevant stuff like threading (e.g. utilize all core’s available on a large scale system) you might get still surprised how even the latest versions of Perl sometimes still have trouble executing threads in a stable way – I seem to get a lot of core dumps and crashes (have to admit with quite some complicated code with interlinked objects that refer each other making memory management somewhat more complicated).

    • Octopusgrabbus

      We’re using Perl in a couple of different ways on Linux (.rpm for production and .deb for my test system):

      1) We’re using it for CGI.

      2) We’re using it for standalone, single process utilities.

      In those roles, it has held up very well over the past 7 years.

      If I were writing a large multi-threaded application, I’d probably be in a group > 1 person, and would go with whatever that group had voted to use, Ruby, Clojure, or Scala (these days).

      If you asked my personal preference, it would be Clojure, and I can justify it for projects I implement and don’t require a consultant, but not for something that we’re doing now. That’s to rewrite water usage calculation and billing.

  2. Jonathan Weavers

    Hey Octopusgrabbus –

    Your last post [Why I Chose Perl To Rewrite Water Billing Programs] was freaking awesome. I have gone ahead and added your stuff to my Feedly account. Please keep me updated if you post anywhere else.

    Keep rocking –

    Jon

    • Octopusgrabbus

      Thanks. I have to keep remembering that it’s best to solve a problem well, and it does not always depend on the implementation language.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s