2013-09-02

Code Incomplete

I'm currently reading Code Complete by Steve McConnell.

So far I'm not very impressed. I'm rather disappointed given the rave reviews and recommendations. He says a lot of sensible stuff, but it's all very basic to an experienced programmer.

There are a few howlers, like claiming Perl and Basic are acronyms.

What annoys me though is his repeated references to 7±2, the supposed magic number of items that the human mind can keep in short-term memory. Although this is a common belief, it is based on outdated science carried out when we did not understand the chunking mechanisms of memory. We now know that it is more like 4, or a bit less.

In McConnell's partial defence, the 7±2 figure is widely believed (and is more prominently mentioned on Wikipedia - at least until I change it!) However, it shows a lack of research for something he relies on so fundamentally.

Near the start of Chapter 7, McConnell uses the 7±2 figure to give an upper limit for the number of parameters to a function as 7. 7! That's hopelessly unmanageable and the sign of a very poorly written function. If he had used the correct(ish) figure of 4, or a bit less, I'd agree with him.

The main saving grace of the book is that he writes quite engagingly but new stuff is pretty sparse. I'm only 1/5th of the way through the book and I'm not sure if I'll make it to the end. 

No comments: