Some self-taught programmers can hold their own with the best coders out there. Others, although smart people, are fundamentally less good at programming. While there is variation among classically trained coders too, they are on average better than their self-taught peers. Why is that? Why can’t self-taught programmers become as good in similar numbers? There are a lot of reasons for this I’m sure, but here is one item that I believe has a large effect. Self-taught programmers often have very little exposure to good programming.
It is not uncommon for a self-taught programmer to work largely alone or with others with similar training. Programmers don’t tend to read a lot of others’ code. If they do, they read the small snippets they find on Google or Live. They don’t read whole programs. Admittedly, it is hard to do this. What gets lost without reading full programs is the way they are laid out. Reading a sample on the web demonstrates how to call an API, but doesn’t show how to organize code into a larger cohesive whole.
I often compare programming to writing. Someone who just knows the syntax of a language and tries to program is like someone who knows grammar and tries to write. Technically, it will be correct, but it might not be much fun to read. Good writing is more than just proper words in proper sentences. It is the way the story flows that separates a good book from a poor one. It is similar in programming. It is the way the objects and functions interact that separates good programming from poor.
Think about a good writer. How did she learn to be a good writer? Practice. But also exposure to other good writing. Someone who is a good story teller usually exposes herself to other good stories. I suspect that most good writers are, or were, avid readers too.
What does this tell us about becoming a better programmer? Like a good writer, it is important that one is exposed to good examples. In college, this comes in class. You are exposed not to large programs–although that happens sometimes–but rather to the ideas that make good programs. Exposure to algorithms, data structures, OS principles, design patterns, etc. all contribute to building up a repertoire to draw upon and emulate. Self taught programmers often don’t get this exposure.
This leads to a simple solution. If you are a self-taught programmer, get exposure to the ideas of others. This can be done either in the classical manner by reading books on databases, compilers, operating systems, patterns, etc. or by reading the code of programs that implement these ideas. If you work in software development, read the modules written by the senior team members. Don’t read for syntax, but try to understand how the big pieces work together. If you don’t, go look at sizeable open source projects. Become familiar with how the pieces fit together.