I had a talk with a younger developer yesterday. We discussed that, nowadays, the most important quality of developer is ability to learn new things quickly. Most of the problems have already been solved somewhere, we just need to reuse it.
This reminds me of old time… (no not punch card, I am not that old yet)
When I first started programming, the Internet connection was scarce. I spent most of my time removing code line by line to find where the error was. Once found, I tried to make sense out of the error message. There was no one to ask.
When I didn’t know how to do anything, I consulted either text book or Help documentation. Googling was not that useful. When I found http://www.javaalmanac.com, I felt that I found a gold mine. (The site keeps pieces of Java code for solving problem.)
Life has changed. The developing environment nowadays has significantly changed, mainly
- Most problems have been solved – You can find 80-90% of the solution in the Internet. Most of them are with code, ready to copy and paste in StackOverflow.
- Open-source has (almost) everything – It is very rare that we need to build anything from scratch. Usage of framework or library is very fundamental for every project.
- Information overloaded – We have abundance of resources. We do not have enough time to digest them all.And they all come with different level of quality.
This greatly influences the way I work. In a good way, I am much more productive than I was (Yay!) In the bad way, I develop many bad habits over years, without realizing it.
Hoping that you will avoid the mistakes I made (and I see many others made), I would list them here:
- Not really read error messages- There was a time when I had a tendency to… google every error message I found, immediately. It seemed to work for 80% of the time. But the 20% took me several hours (or days) because I did not understand the problem. The worst thing is, when the same issue occurs again, I never remember it and has to Google it again. This is because I never really understand what went wrong.A good example is Git, I had been using it for half a year without understanding the concept behind. When I see an error, a few seconds of Google will give me a “magic” command that solves everything. Of course, the magic doesn’t work everyday. And when it doesn’t, it usually causes me at least half a day.I learned this point from pair-programming with one of my colleagues. One moment when we ran into an error, he stopped and read it. He REALLY read it before googling. When he saw something he doesn’t understand, he googled further and try to understand what really went wrong.
Despite that, he usually finishes his stories quicker than others. He is, in my opinion, the most productive guy in our team. Of course, there are many factors. But one of the factor I guess is that he accumulated skill from really understanding of those errors. This skill allows him to avoid repeating the same mistake, and troubleshoot new errors more effectively.
- Copy & paste the code without understanding – There is a saying that it takes you 200% of your knowledge to debug the code you write. So don’t do anything too clever, or you won’t be able to debug it.The same goes for copy & paste. If you don’t understand it, read it through first. Or you will pull your hair out when it breaks.I once found a bug that happens every 24th of December. When I asked other senior colleagues, they said that it happened in the last year too but no one found the root cause. Since there is almost no user in the system on that day, and they couldn’t reproduce it on 26th, no one bothers to fix it, meh…
So I debugged it.
I found a piece of code that has very strange variable names and different coding style. I didn’t understand what it does. So I pasted it on Google and found that piece of code on a blog with a very good explanation. It turns out that one of the variable that should be changed in that piece of code got the wrong values.
Moral of the story? If you don’t understand how it works, don’t put it on your repository.
- Read everything – You understand it correctly. It is a pitfall to read everything.A lot of developers write blog, but not all of them are well-written. It is much faster to absorb the well-written material (like a good book) than reading multiple pieces of blogs written by different authors (with different style).I am not saying that you should unsubscribe those newsletter and RSS (if you still use it). But you need to be selective. Skim before you read it through.
We have too much information today, most of them are duplicated. AngularJS tutorial is a very good example. And if you read a bad tutorial, bad practice will be with you for a long time.
In conclusion, don’t repeat my mistakes. Be better than me, be more efficient than me.