Jul 4, 2008

Some Good Reads

Some good books that I have read recently that I recommend (for programmers):
  • Effective C++, 3rd Edition by Scott Meyers. Don't stop reading now if you're not a C++ programmer. The value of the book is highest for C++ programmers, but there are many things in here that apply to other languages, like Java and Ruby. It is tips on how to effectively use the many language features to avoid writing buggy code, to write more maintainable code, good uses of the standard libraries, etc.
    Reading this book really helps you appreciate the language and libraries and how well engineered they are. Either that, or it makes you appreciate <insert your favourite language here> because you don't have to deal with all the low-level details that C++ deals with.
    The value is obvious to C++ programmers, but what about people using other languages? The book gives tips on how to avoid memory leaks. Other languages have memory leaks too, but in a different way. Suppose your code is very complex, with nested loops, etc. You may forget to remove references to variables that are no longer needed. Oops! Out of memory. Then make some explicit unset() calls here and there and the memory problems go away. I've seen this happen in PHP a lot. I thought it was a garbage collected language! I can imagine this would also be the case in Java or Ruby.
    There is a lot of info on OO design and programmer etiquette when using references, constants, etc. This stuff applies to other languages as well.
    So even if you don't program in C++, I would say check this one out. I have a copy if anybody wants to borrow it. If you're a C++ programmer though, I would recommend you buy this guy so you can refer back to it when you need to.
  • Structure and Interpretation of Computer Programs by Harold Abelson and Gerald Jay Sussman. This is an introductory programming textbook at MIT and is available for free at the link I provided. Now you may be thinking, "I already know how to program!" This may be the case, but an intro course at MIT is probably much different than an intro course at most other universities. For example, the language taught is Scheme, not Java (most schools that I know of teach Java as a first language). Why? My interpretation of their reasoning is this: all programs in any language are effectively two things lower down: data and processes that manipulate that data. Scheme (along with most functional languages, but Scheme does it more obviously) blurs the distinction between the two and lets you see the program for what it really is. After all, Scheme code is essentially written as a parse tree, which is what pretty much all programming languages are expressed as internally.
    So why do I recommend this book? It's free. It was written assuming no programming knowledge, and written to teach. It contains exercises (good exercises) to get you going. Scheme is also free, as is Dr. Scheme, an excellent editor for the language. Finally, knowing how to program in a functional language will make you a better programmer in non-functional languages. I saw this in myself when the functional programming light-bulb went on in my head. I can imagine you could see it in yourself too.
  • Any book on design patterns. The above book lets you see the essence of your programs, but this one teaches you how to design your programs in nice, manageable ways.

No comments: