I am constantly trying to be a better programmer because I want to be able to make better things for people than what they already have. I think most programmers, as compared an average profession, have a strong desire to improve and “invest in their knowledge portfolio” because learning has an easy-to-see impact on what opportunities are available. It occurred to me that the way I do this for myself is very structured and thus can probably be systematized and possibly benefit others. Here are three questions I always ask myself when approaching a problem or a new project in order to become a better programmer:
1.) What were the bottlenecks, annoyances, or performance issues of the last code that I wrote that can be improved? It does not matter what problem I am solving, there are certain things that I do no matter what type of code I am writing, from formatting, style, and documentation, to deeper things like how I cache fetched objects. If I strive to even make just one thing better, or faster, or prettier than last time, I become a better programmer.
2.) Is there anything I take for granted about what I am about to code, and if so, is there something better? Curiosity about what I take for granted is the best way I’ve found to improve my skill set. For example, most people (myself included) use their favorite language with their favorite server (NGINX + unicorn) whenever they are starting on a new web project or need to build a new feature, whether or not it’s really the best option for the job at hand. I question this every time I start on something new. And I don’t just mean looking at new languages and new types of server - I mean sometimes the best option is writing my own server in my own language. In order to come to that decision, I need to question all of my assumptions. It’s not easy to do, but just by questioning and investigating things I take for granted, l become a better programmer.
3.) Has anyone else solved this problem or done this type of thing before that I can learn from? Googling effectively is part of my skill repertoire and since I don’t know what I don’t know, I need to try and look at as many different sources and hope I stumble across new leads, terms, languages, libraries, or anything that I couldn’t have thought of myself. And a lot of the time, such research leads to things outside of what you were originally looking for in the first place. For example, I recently wanted to speed up JSON parsing on our servers so I looked to see if there were good alternatives to the Rails default. It turns out there are but at the same time I stumbled across Jbuilder (it now ships with Rails by default, I believe) and I was inspired by its approach to building JSON objects, from the usage to the implementation. I ended up creating a module based on Jbuilder that has similar usage but an implementation that takes into account some of my unique needs. Googling makes me become a better programmer.
Lastly, I think it’s obvious but if you’re a programmer and not reading Hacker News, I guarantee you will miss out on things every day that will make you a better programmer.