13 June 2011


Often in our industry the M in RTFM is the code itself.  Yes, there should be more documentation but ultimately if you are a developer the code is all too often either the sole documentation or the most up to date documentation or the only worthwhile documentation.

For me it is no longer just a matter of necessity, admittedly over the years I feel I have developed pretty efficient code grokking skills, but ultimately it has become more of a way of life for me.  If I work with you or for that matter if you publish your code on the internet I will look at it.  If you claim, or are claimed by a third party, to be a good developer and I can look at your code to verify that claim I will do it in a heartbeat, if you have solved a problem that I am trying to solve or you potentially have a better solution or are using a technique that I am unfamiliar with, or are a better coder, I am all over your code.

The best developers are developers those who read code and those who read in general. The great thing about the industry today is there is no shortage of code to look at or general reading material.  As I have previously mentioned I currently work a fair amount with the Spring Framework, looking at the Spring Source code has helped me become a much better programmer and has exposed me to many new concepts.  Also reading the code allowed me to access many useful classes and functionality that are used internally by Spring but are not well documented.

I am frequently amazed (disappointed) by the lack of intellectual curiosity that many developers have for reading code.  I recall on one previous project we had to create some custom Servlet Filters, another developer had created the initial prototype and I refactored it, one thing I changed was I added Spring’s Ant pattern support for the configuration which was needed to exclude some paths, this feature was not well documented at the time and you had to read the code to figure out how to do it.  When the initial developer saw my changes he remarked with surprise that I figured out how to make it work like Spring Security.  I responded that all I had done was dug into the Spring source code to find out how they did it.  Perhaps my most irritating example of this is a project where we were in the process of making some refactoring changes which had a number of deprecated classes and in some cases entire packages of deprecated classes, and this one Cargo Cult Coder rolls in talking about how he was going to fix our architecture, of course he doesn’t bother to look at the existing code base and then he proceeds to add a class, which was also redundant, to a package where every other class was deprecated! Really!?! When a developer, especially a senior level developer works on a project with an existing code base it is their responsibility to learn the existing code base.

If you don’t read code you’re not a real developer!

No comments:

Post a Comment