Coding Style – A Fine Line Between Clever and Stupid Part 2

Continuing from my previous post, I wanted to write about something that I have found to be a bugbear – the idea that functions or methods should have a single exit point.

But first, another quick reminiscence of my days programming mainframes with PL/I. There were no internet connections to the machine, data came in on tapes. Someone who wanted to get their own nefarious data onto our machine would have had to intercept a driver, get the relevant tape, take it to a conveniently located mainframe resource, load the data off the tape, insert their own data into the records, put it back onto tape, drive it to our office with a driver with an appropriate security pass… and so on. And I didn’t even mention knowledge of record formats or file validity checks and so on!

Continue reading

Coding Styles – A Fine Line Between Clever and Stupid

I’ve been thinking a lot about coding style recently. I must admit that I have probably always tended to code in a way that would be considered to be verbose by many programmers. Although I learnt to program by myself, I benefited from an extensive professional programming course in PL/I (which doesn’t date me too much, but it does date the machines I was working with!)

Continue reading