ProgrammingThis is a very short synopsis of learning to write quality code well, and to enjoy it. Learn a system language, and a scripting language. I concur with Eric Raymond that C and Python are two ideal languages, and have the greatest "legacy". Given the realities of the marketplace, I might suggest Java over C, and for enjoyment, Ruby over Python. Perl is an excellent choice as well, and less so, C++. Rule of thumb: write in the scripting language as much as possible, then rewrite what is necessary in the system language. Program in the language you are using. That is, as with learning music, copy the masters as closely as possible. The ideal way to do that is to read the code that the language authors write. Since they are more likely to "get" the language better than anyone else, their style and idioms will likely reflect the purest interpretation of it. So read the Java (JDK) source code, for example, and the Python and Ruby libraries written by their authors. Write a lot of code. And throw away 99% of it. By throwing away code, the code you have to rewrite will be redone with a clearer perspective. Then release the code you retain. Writing for an audience increases discipline and quality. Read. Choose major publishers, such as Addison-Wesley and O'Reilly. Quick rule of thumb: a photo of the author(s) on the cover is a bad sign. (This applies to other subjects as well as to programming.) Read the classics. Even if they are in the "wrong" language. Read the Kernighan and Ritchie book, Programming Perl (first edition, the classic), Design Patterns, and The Pragmatic Programmer. Avoid fads. A company pushing a technology (e.g., ActiveX, CORBA) is not nearly the same as a grassroots movement (the web). Best, if a technology is popular without being embraced by the major companies, it is likely superior. Enjoy it. Chances are if the programming task is not enjoyable, you haven't written enough tests, do not understand the problem, are doing something not worthwhile, or are under a deadline that is too restrictive. Or are not making enough money. Write therapy code. Write code that you enjoy writing, even if no one else would want to use it or read it. Ironically and somewhat tragically, the more unenjoyable code you "have" to write, the more enjoyable code you should write. |
|