Optimizing Developer

Have you ever looked at a code that you wrote several years ago? I have to do this all the time, after all I am working on the same application. Not only do I do it to fix bugs, but I do it to optimize the production code. And at times I see my old code and think what was I thinking when I wrote this. You see, with every release our main product grows, new features, core changes, you name it. One can say that we are optimizing the software by adding things our clients ask for and this leads to optimization of code. Optimizing your code is extremely important, normally there are few ways in which a particular problem could be solved, but if you are serious about your work, you do want to pick the most efficient way of doing things. Many books have been written on the subject, simple Google search will produce lots of articles concerning code optimization. Today I am not going to talk about that, instead I will talk about optimizing a developer.
If you are like me – doing coding full time and at times after hours, you want to achieve something which falls beyond simple financial compensation for you work. I want to grow as a developer. I have read somewhere that it takes roughly 10000 hours to master a task – be it musical instrument, a sport or any other activity. I think similar thing is applied to programming. I have been thinking of a way to apply optimization to myself, after all if my code can be optimized, why can’t the writer of the code. Here are some principles that I have came up with. This works for me, might not work for everyone. Once again, just my own opinion.
So here it is – list of things I (or you) need to know:
Data Structures.
Have you ever thought as to why virtually every course on a programming language begins with overview of your Data Structures. Pick up a book on any programming languages, I guarantee you you would find explanation of some basic types as well as more complex types within first 20 pages of the book. Why do all authors bother putting virtually same information in? Data structures are basic building blocks. If you don’t get the data structures, their limitation, advantages and benefits, you might as well stop coding altogether.
Language.
Let’s be honest, it is not that difficult to pick up a new programming language once you mastered couple. At first all you notice is changes in syntax, for instance Ruby is much more “English” like language in my book then let’s say C. But it goes beyond syntax and different names for your data structures. Every language has it’s own ways of doing things, which might not seem all that obvious to a novice. Spend time, learn tricks of the language, you will get better appreciation for the hard work authors of the language put into it. You would also gain deeper understanding of how to solve that problem in the best possible way.
Compiler / Interpreter.
Compilers are mysterious pieces of code that actually make sense of what a coder is trying to accomplish. Every compiler is different, with its own routines for optimization, process handling and so on. I don’t think it would be fair to say that one has to become an expert on his compiler of choice, but more understanding of how your code is compiled or interpreted will give you advantage in writing this code in the most efficient manner.
Community / Ways to solve the issues.
One of the greatest things about internet is that it gives you access to incredible amount of resources. Most of the time a search engine is my friend. When I am stuck on something, I can always search for a solution and even if I can’t find the solution directly, there are always some situation that are different in many ways and could be applied to solve the issue. Here is an example – few years ago I was stuck with a problem. The project took about 3 month to complete, and at the end we found that one issue, which had nothing to do with data, more of a user experience absolutely prevented us from releasing the feature. It was one of those situations where 3 month of your work is wiped out by something that you assume was so easy and obvious, but in reality was completely impossible. Searching for the solution took about 3 weeks, I was not about to give up on 3 month of crazy coding. I had tortured Google, developer communities, message boards, IRC channels, forums (I think I was even banned couple of times for my persistence), finally with a help of paid support we had an answer which was – “this can not be done”. This was a total disaster, but through the communication with paid Development Support at Microsoft, the engineer that was working on the case with me, accidentally helped me solve another huge issue which was a limitation that was scaring away many potential customers. So what happened to the project? We found a hack to have it work, warned users not to do a certain things at certain instances. While the original problem was not fully solved, the other huge issue was, and at the end I learned lots of new things and got to talk to many coders.