I’m a self-taught intermediate Python programmer; I frequently come across popular books on software development and programming written in other languages (often Java).
Typical examples:
- Refactoring: Improving the Design of Existing Code
- Design Patterns, Gang of Four
- Test Driven Development: By Example
- The Art of Unit Testing: With Examples in .NET
Generally speaking, how useful is it to read a book written for another language? Specifically, what about Python? Should one stick to language specific books?
For example, a lot of people praise Design Patterns by the GOF, I’ve never read it because the model applies to other languages (after all Python is about anti-patterns, right?) yet I feel the urge to because of it’s place in the CS literature cannon.
Likewise, would The Art of Unit Testing: With Examples in .NET help a Python programmer learn unit testing even though the examples are in .Net?
4
Absolutely! It’s actually very helpful to break away from your primary language occasionally because this lets you see programming concepts through a different lens which will allow you to gain new perspectives.
What makes any software good, or high quality is never about the syntax or language of choice. It’s how that language is applied. Steve McConnell calls this programming into a language instead of programming in a language.
McConnell wrote Code Complete, a book I highly recommend. He makes a specific note why the examples are in many different languages. One of the reasons is he wants the reader to focus on the concepts he is illustrating and not on the syntax.
The books in your list describes general concepts that would certainly be useful to any programmer, regardless of their language of choice.
Starting out you do want to focus on just being able to write code that compiles. It doesn’t take very long to learn the syntax of a given language and with documentation and intellisense this takes even more away from how much you have to actually remember. Most languages can be learned within a few months. However, writing high quality software is a discipline and craftsmanship that takes years of practice and experience and even then there will always be room for improvement. Learning about design concepts such as how to make your software more testable, modular, loosely coupled etc. will open your eyes on how you look at code in general.
When you stop caring about syntax and can see code through a neutral lens then this will truly benefit you as a programmer.
2
First of all, some of the books you mentioned are written with examples in multiple programming languages. For example, GOF’s DP is written with C++ and, if fewer, Smalltalk examples, and TDD is written with Java and Python examples.
If you are well trained in picking up what’s useful, dropping what’s not, and translating what you’ve picked up, you’ll benefit from reading most of generally recommended books for programmers. However, if you have little experience in doing this, you could start from “near-transfer” books. Otherwise, you will learn very little, or even you will learn bad ideas and habits — some of the practices are language-paradigm dependent. I have seen a good deal of Python programmers with all the hassles for implementing GOF’s DP in C++.
Transfer is psychological and educational term for applying what you have learned in a different context. They differentiate between near and far transfer. Usually near-transfer is easier and more effective, which means you need to put more effort for far-transfer.
For near-transfer learning, I highly recommend learning from similar languages, in terms of its paradigm, to your target language — siblings in the language typology. For Python, that would be something like Smalltalk — or nowadays Ruby but Smalltalk’s legacy is greater.
For instance, you will learn a lot more from reading DPSC than from solely reading GOF’s DP. (BTW, reading both DPSC and GOF’s DP at the same time with careful contrasting and comparing is a very rewarding learning experience)
From my near-transfer experiences, I remember leaps of improvement in my Python programming from reading books(articles, papers, and etc) for Smalltalk, APL, Io, and ICON, all of which are dynamic in nature.