Monday, 28 September 2009

Three times older than when I started

I celebrated being exactly 3 times the age that I was when I first started working for IBM, on 30th April 2009.

Here's the REXX exec to demonstrate it

/* Routine to calculate when you will be exactly 3 times older than when you first started working. */
dob = date( "B", "30 Jul 1958" ) /* 714989 */
startwork = date( "B", "30 Jun 1975" ) /* 721168 */
age = startwork - dob /* 6179 */
enddate = startwork + ( age * 2 )
say "Herb will be 3 times older than his age when he first started working on" date( "W", enddate, "B") date( "N", enddate, "B" )

As always the comments to explain the code were a lot harder to write than the code.
And it's a pretty useless program unless you're me.
You could ask Angus Tuckey-Smith, Mat Caney or Mike Cowlishaw for an improved version that will work for anyone...
But if you think about it, most people will have left work by the time they reach the required age, so won't have a REXX interpreter to run the code anyway.

PS. Ajay R Krishnan has a similar program written in Python.

No comments:

Post a Comment