There are programming standards, and then...this

Flashback to 1985, when this Cobol programmer pilot fish is handed an old, large program he's never seen before -- but he already knows it's going to be trouble.

"It had been modified many times," says fish. "I was told to figure out why the most recent changes caused the program to miscalculate some figure.

"The program started off with the usual housekeeping processes, including a line that read PERFORM REPORT-HEADINGS THRU REPORT-HEADINGS-EXIT. I saw no need to verify the report headings, so I moved on into the meat of the program.

"After a few days, I realized I was totally lost in the code. The program didn't appear to be doing what I had been told the program did. I was forced to turn on tracing to try to figure out what the program was doing.

"That was when I learned that when the program executed the PERFORM REPORT-HEADINGS line, it never returned to the main program flow.

"It seems that in the REPORT-HEADINGS paragraph was another PERFORM command and it never encountered its EXIT either, because there was another PERFORM that never came back, and another one, and...

"Turned out some nitwit had been told not to use GO TO statements, so instead he used PERFORM statements that never terminated!

"And the code that I got lost in, the code following the PERFORM REPORT-HEADINGS, was never executed since program control never came back from the PERFORM.

"So much for the 'No GO TOs' rule."

Make your story GO TO Sharky. Send me your true tale of IT life at sharky@computerworld.com. You'll score a sharp Shark shirt if I use it. Comment on today's tale at Sharky's Google+ community, and read thousands of great old tales in the Sharkives.

Get your daily dose of out-takes from the IT Theater of the Absurd delivered directly to your Inbox. Subscribe now to the Daily Shark Newsletter.

Copyright © 2017 IDG Communications, Inc.

It’s time to break the ChatGPT habit
Shop Tech Products at Amazon