Macha

Programming Books

August 21, 2010 | categories: Programming

It used to be the case that when I wanted to learn more about programming, I would go down to the book store, buy a book about the language I was using and read it through. However, the problem with these books is that after a while, you only really want the last 5 or so chapters, detailing the bits of the standard library you are going to use. The language docs are usually a pretty good explanation of the syntax. You definitely don't need a full chapter devoted to if statements and loops, for the fiftieth time.

What you need on if statements after the first language is just a small paragraph like:

Python if statements are done like so:

if condition:
    doStuff()
elif other_condition:
    doOtherStuff()
else:
    doOtherOtherStuff()

Seven lines, not a whole chapter. Oh look, the language docs do that. Never mind then. Those chapters are now totally redundant. Spending €40+ for the last 5 chapters really doesn't make sense.

The other problem is one of quality. Several books promise to teach you everything about something, yet obviously fall far short of it. An extreme case can be seen in the two books I bought around 2-3 years ago, when I was first learning PHP.

1300 page long "Beginning PHP and MySQL", 200 page long "How to do everything with PHP & MySQL"

Which title do you think is more accurate?

Even apart from the amount of extra information in the Apress book, the quality of that information is far better. The smaller book doesn't even mention how to create a class. And it would have you believe that the only way to interact with a database is through the old mysql library, using functions like mysql_fetch_assoc(). Oh, and to really rub it in, it does actually mention MySQLi, but basically as a slightly faster version of the MySQL functions that needs to you put an i in your function calls, and nothing else. The example code in it always mixes code and markup, and then you wonder why PHP has such a bad reputation, when there are so many books like this floating around.

The problem is, many people will look at these books, and see the Apress book looking much more formal, and presume that's it's full of unnecessary detail. I did at first (hey, I was just starting out), which is why I initially bought the second book, then had to go back and buy the other one when I finished the first one, and realised I could of learned the same amount of stuff from 2 hours and an internet connection.

Of course, eventually, every programmer moves on from these books to more general ones about coding in general, rather than specific technologies and languages. The problem is, many book stores don't bother selling anything more advanced. And the only computer shop where I live, PC World, has an even more pathetic collection. So you have to wait ages for something to turn up. Or have someone recommend a book, and then buy it online. You can't browse through books, flicking through a chapter of each to see which looks better, on eBay or Amazon unfortunately, which rather limits the options for just looking around for something good.

Moving on to better books, like this one.

The first proper programming book I got was Code Complete, second edition, which I bought roughly a year ago. I'd heard a few people recommend it before, but hadn't went to buy it. I was amazed when one day, among all the copies of Excel for Dummies and iPhone for Seniors, there was a copy of Code Complete in the book store. I presume someone had ordered it in, and the store had just got a few of them, because it's sadly not the kind of book they usually get. I suppose they rather books that don't require the customer to have some knowledge already. (Which is odd, because surely they'd be able to sell two books with an offer like "Buy this book to learn how to program, and this book to learn how to program better.")

Unfortunately, even when you know what book you want, the book stores don't do themselves any favours. Around this February, I had €30 in book vouchers for the local bookstore left from Christmas, and decided to buy Design Patterns with them. I had the PDF version, but I still read best from dead trees, so I had a look. Unsurprisingly, they didn't have it there, as most of their books are of the Language x for dummies/Buzzword y in 24 hours variety. Oh, and they have Code Complete again as well, but I already have that. So, as I had expected, they would need to order it in. I had checked beforehand, and the book was €30 delivered from Amazon. I expected it might be maybe €40 in the bookshop, cheaper once you factored in the vouchers I already had. It wasn't €40. It was €82. I don't know what planet they are on in the bookstore, but needless to say it's led to Amazon being €30 richer.

A welcome development is the trend towards free online books. Examples such as Dive Into Python, Programming Ruby, Dive into HTML5 and Real World Haskell do help with their respective languages. And the fact that they tend to be more concise than the usual books on the shelf (I know they come on dead trees too, but nowhere near me sells any of them) also makes them more useful, even despite my preference for reading from a physical book.