Wednesday 21 December 2011

Strange Programming Languages: RPG II

Opinions differ on the best programming language. Opinions also differ on the strangest programming language. I am going to offer my own humble opinion on this.

I want to talk about two contenders: RPG II and LISP. In this posting I will deal with the former.

RPGII was the first language that other people paid me to program in (well, more or less). “RPG” was an acronym for “Report Program Generator”.

It is an extraordinary language in a number of respects:
  • It has its own “cycle” where it will read a record, perform some computations, and then output something. The input could be from a file or from a screen which has been displayed on the workstation. The output could be to a file, the screen, or to the printer. The cycle just kept repeating over and over until all of the available records had been processed.
  • It used “indicators”. This was a set of Boolean values which could be set, cleared, and tested. So when a record with a “A” in column 1 was read from an input file, you could specify that indicator 10 should be turned on. Then you could have computations that were only executed when indicator 10 was on, and output that was only written when it was on also.
  • Code had to be put into the right columns in order to be valid: the columns were significant. For example, the operation code for a calculation had to start in column 28. In order to read a printout of a program, a developer would use a “template” which would show the purpose of each of the columns.
There were 99 ordinary indicators (01-99) which could be used as needed.

There were also special indicators such as:
1P – which was only on during the first output cycle (“1st page”)
LR – which was only on for the “last record”
MR – was put on when there were “matching records” in two input files (when reading customer and transaction records from two different files, for example).

Once, when I had just started as a programmer in an insurance company, an auditor approached me looking to see a sample RPG program as he had been told by one of my colleagues that RPG was “self-documenting”. I told him that I had just joined the company and it would be better for him to ask someone else and off he went. What I did not tell him was this: RPG II was probably the further thing from a self-documenting language that there ever was! Here are a few reasons:
  • To read the code at all, you needed to understand the built-in cycle and what F specs, I specs, C specs etc. were all about
  • To read a code printout, you needed an “RPG Debugging Template”. You could line this up with the code and it would allow you to recognise the columns (I can’t believe that (a) I don’t have one of these and (b) I can’t find a picture of one on the web!)
  • All of the operation codes were limited to 5 characters. So there were operations such as “Z-ADD”, “LOKUP”, “SETOF” and (my personal favourite) “XFOOT”.
  • Field names were generally limited to 6 characters (contrast this with current best practice for Java!)
In some ways (although it was a MUCH higher-level language) reading RPG code was a little like reading Assembler. But people writing Assembler code tended to write a lot more comments!

To see a sample of RPG II code, take a look here.

In conclusion, although it may not seem like it from what I have said above, I was a big fan of RPG. It was quirky and obscure, but you could get a lot done with a very small amount of code. The build-in cycle did so much of the work for you. And although I understand that flavours of RPG are still in use today, one this is for sure: we will never see the emergence of another programming language like it!

Sunday 18 December 2011

Best Christmas book ever: The Christmas Miracle of Jonathan Toomey

The best Christmas book ever written is The Christmas Miracle of Jonathan Toomey.

The book was written by Susan Wojciechowski and illustrated by P.J. Lynch. It was first published in 1996.

For a number of years now I have read it to my kids every Christmas. And every time I have had to pause as inevitably something would cause my eyes to water for some unknown reason.

The story is beautifully written and very moving.

This year my daughter Ruth (9) read it aloud instead and again there must have been dust particles in the air because I found myself having to wipe my eyes again.

I cannot recommend it highly enough.

In preparing this posting, I discovered that:
  • Susan Wojciechowski has a website 
  • P. J. Lynch is actually Patrick James Lynch and he is Irish, born in Belfast and, according to his website, currently living in Dublin.
  • The book was made into a movie in 2007. It stars Tom Berenger and Joely Richardson. I see that our own Saoirse Ronan also has a role in the movie. It currently has a rating of 6.6 on IMDB. The movie is available here. Might be worth taking a look.

So many more Irish connections than I was expecting.

Saturday 17 December 2011

Data, Information and Knowledge

As a result of a project I am doing in work, and some study I am doing for college, I have been thinking about the distinction between data, information and knowledge. I have come up with an example which helps to distinguish them for me and I would like to share it.

Data is the lowest level of these three concepts. Data consists of simple “facts and figures”. For the purpose of this example, the following is a piece of data: 914 baby boys who were born in Ireland in 2010 were given the name Jack. While this fact might (or might not!) be interesting, it is not very informative.

Aside: Intellectually I know that data is the plural of datum. This means that you should use phrases such as “the data tell us”, “the data indicate” and “the data are”. Many phrases such as “entering the data” and “validating the data” are unaffected by this distinction. But I myself find it must more natural to write “once the data has been validated” rather than the correct version of “once the data have been validated”. But maybe that’s just me!

The next level up is Information. Information is gleaned from data by asking questions of it.

Aside: I am reminded of the part of the The Hitchhiker's Guide to the Galaxy books where a supercomputer (“Deep Thought”) is built to answer “the Ultimate Question of Life, the Universe and Everything”. The answer turns out (after 7.5 million years of computation) to be 42 and then the people have to build an even bigger supercomputer to discover the question. So they were looking for knowledge (ultimate knowledge in fact) and they end up with a datum!

In the case of boys’ names, you might want to know where Jack ranked in terms of popularity during 2010 (particularly if you wished to avoid using one of the most popular names). The answer to this question is that Jack ranked number one in terms of popularity. A supplemental question might reveal that the second most popular name (Sean) has 812 occurrences. This is over 100 less which indicates that Jack is the overwhelming favourite. This information would be a red flag for parents who didn’t want to send their son to school with 2, 3 or 4 other Jacks.

So in our example data has fed into information. But does knowing this information equate with having knowledge? I would argue that this is not knowledge because the value of this piece of information decays over time. The information will be less relevant with each passing year. In 5 or 6 years’ time this information (about 2010) may have very little value to people selecting names.
Knowledge is the level above information because it has a much longer shelf-life. Rather than facts and figures, it concerns itself with truth and understanding.

Steven D. Levitt and Stephen J. Dubner wrote an entertaining and thought-provoking book called Freakonomics: A Rogue Economist Explores the Hidden Side of Everything in which they try to extract knowledge from data by asking questions of it (or should I say “them”!).

In relation to baby names, they conclude that the evidence indicates that names move through the population from a higher socioeconomic level to a lower level. They further concluded that when a particular name has been widely adopted then the "high-end parents begin to abandon it," and the whole process starts again with a new crop of names.

You can read the opening of this chapter online on their website here.

Another interesting piece of nascent knowledge in relation to baby names is described on their website. This is that the rate at which a name gains popularity will be mirrored by the rate at which it loses it. You can read it here.

Postscript


Douglas Adams was a genius and the Hitchhiker books are hilarious, full of fun and invention.
But my favourite single quote from Adam is this:
I love deadlines. I like the whooshing sound they make as they fly by.

Wednesday 14 December 2011

Early Computer Systems

My first job was as a “Computer Operator” in a long-gone company called “Computime” in Dublin.

Computime was a “Computer Bureau”: a company with a computer on whom other companies who could not afford a computer would depend for applications like invoicing, debtors, creditors, payroll, etc.

It’s hard to believe in these days of ubiquitous computing that there was a time when successful businesses did not have a computer of their own!

Anyway, when I joined in 1979 they had the following equipment in the computer room:
I'm pretty sure the System/3 had 4K of memory. Not very impressive when my Apple ][ at home had 16K. But the 1403 printing at full speed was a far cry from the Epson dot matrix printer I had at home!

This picture shows an operator (who doesn’t look as any of us did!) changing a removable disk on a System/3:

The “data prep” staff worked in the next room performing key-to-disk operations using a number of IBM 3742 workstations. Here are pictures of the 3741 and 3742:

Simple, happy days.

Some day I must remember to blog about the day one of the operators pulled the “Emergency Pull” switch on the System/3! Heaven only knows why a computer would have such a switch! Perhaps the designers were thinking ahead to the day when one of their creations would become “self-aware”!

Tuesday 13 December 2011

Best Christmas Songs: Peace on Earth/Little Drummer Boy, Fairytale of New York, White Christmas

So Christmas is well on the way.

As I make this posting, I am listening to the best 3 Christmas songs of all time on Grooveshark.

They are (this is the order I am playing them and also my order of preference):

1) Peace on Earth/Little Drummer Boy - Bing Crosby and David Bowie
2) Fairytale of New York - The Pogues
3) White Christmas - Bing Crosby

Wikipedia has the following to save about songs 1 and 3 above:

Peace on Earth/Little Drummer Boy

Crosby's last TV appearance was a Christmas special filmed in London in September 1977 and aired just weeks after his death. It was on this special that Crosby recorded a duet of "The Little Drummer Boy" and "Peace on Earth" with the flamboyant rock star David Bowie. It was rush-released as a single 45-rpm record, and has since become a staple of holiday radio, and the final popular hit of Crosby's career. At the end of the century, TV Guide listed the Crosby-Bowie duet as one of the 25 most memorable musical moments of 20th-century television.

White Christmas

The song remains the best-selling single of all time. According to Guinness World Records, Crosby's recording of "White Christmas" has "sold over 100 million copies around the world, with at least 50 million sales as singles."

I wish it was OK listen to Christmas music all year round!

I guess if it was then this station wouldn't just be broadcasting during December:
http://christmasfm.ie/

How time flies...

I can't believe it has been over a month since I posted to my blog!

My only excuse is that I had 3 assignments to do for college over the last few weeks and they took up all of my free time, my energy, and my creative juices!

But they're submitted now and I'm back and bursting with ideas!