Go to the source

07 Oct 2012

This is probably one of the most powerful ways to improve the quality of your code. If you use this often you will save time and get a better grasp of the tools you use everyday.

The source code.

Instead of using Google or StackOverflow when facing a problem, dive into the source code to find out exactly how things work and what tools you have available in a given scope. Popular open source projects tend to be very well documented: wiki pages, source code with comments (even with usage examples) and tests, which will shed light on trickier methods.

Give it a try with a tool or library you use a lot. The next time you're feeling lost just go to the source, and I promise you'll be out of there faster and with a better understanding of how things work.

Now this might just be me rambling, but it could make you understand my point

What do you want to be, a better "googler" or a better coder?

Think about it, there's nothing like the source code of a project and its official documentation to find the correct answer. Using Google to find a solution in order to save time is a really bad habit. Sloppy snippets of code will often appear in the first results, and people who don't know better will use them. You learn nothing valuable by doing this.

Besides, when using a popular library or tool, the source code is obviously the first place where updates appear. After that it will probably be the official documentation, followed by blog posts, questions in StackOverflow, and all your other "shortcut" sites to solve a problem. In the long run I can guarantee you Google won't help you. You'll be months behind, if not years.

Reading code written by the best is also a great way to become a better coder yourself.