5 sure-fire ways to become better at programming
My previous semi-humorous blog post on becoming a bad programmer generated a lot of reaction, so I decided to write one more, this time eschewing the humor (some appeared to not *get* it) and just jumping to the list directly.
1) Be an apprentice first
Becoming a programmer is like becoming a mason. In the medieval ages, a mason had to first become an apprentice, work hard for several years before becoming an independent mason and joining the guild. Unfortunately, no such process exists for programmers. It is my opinion that programmers need the same mentoring before they develop good programming habits. If you have never met or worked with someone who is a better programmer than you, you are unfortunate. Without the ability to work and see at first hand the habits and processes of great programmers, it is hard to become one. My ability to handle complex problems increased dramatically when I worked with great programmers.
2) Continually adjust your complexity mental models
Programming is purely a mental activity and has no relationship to any physical activity including typing. To become a better programmer, you will need to exercise and build up the part of the brain that deals with managing complexity and dealing with the relationships between countless objects.
So how do you actually get better at this activity? It is by continuously learning from mistakes and tweaking your understanding and process by which you manage complexity. When you continuously refine your complexity models, you get better at managing complexity more efficiently. There is no end to this process – as you work on more complex projects, you will add more tools in your arsenal to manage complexity inside your head. The important thing to realize is that a mental model exists and that you must act consciously to improve it.
3) Be curious about new trends in computing
Programming, unlike bridge building changes the basic tools and processes every 5 years. It is hard work to keep abreast of the changes. But keep up, you must if you don’t want to be left behind. From programming with punch cards, Waterfalls, Assembly, Windows, MFC, Java, J2EE, .NET, PHP, Ruby-on-Rails, REST, Agile Programming, Design Patterns, AJAX, you will have to keep up with the rapidly changing landscape. And I say this not to keep jumping on the latest fad, but to keep up so that you understand the latest technologies and the benefits (and cons). Programming is partly about building things efficiently and choosing the right tool for the job. To get that piece right, you *have* to know what exists out there. Otherwise your program will be obsolete by the time you are ready to release.
4) Understand the major pieces of the software stack
Joel Spolsky talks about leaky abstractions. That is when you work with any abstraction, it always leaks a little bit, allowing the ugly underlying complexity to seep through. When that happens, if you don’t have an understanding of the layer below you will be screwed. Say you are a web programmer, you need to know a little about HTTP. If you are a .NET or MFC programmer, you need to know something about how Windows messages works.
Modern programming environments are little like fishbowls. You can live happily within this world for eternity, but if you want to do more than what is provided within the confines of the fish bowl, you better learn more about the *outside*.
Learn a little about all the pieces of the software stack, from registers in a CPU to low level memory management, process management, networking and so on. You will never be surprised or stopped dead by the glass walls of your fishbowl.
5) Be passionate
To become better at programming, the one sure-fire way is to be passionate about it. You need to be genuinely interested in working, thinking and living in code. No amount of knowledge, experience will otherwise help.
Agree, Disagree? Let me know.