One of my favorite books on coding is Clean Code by Robert C. Martin. Here’s one of the most important concepts that caught my eye: Readable code is important. You need to write code for people and not for machines. So what does reading good code have anything to do with writing it? Let’s find out.
Clean code is the ultimate weapon behind any successful software project. The stimulating power behind this concept is pretty simple. Any expert can tell you that the most time consuming task that a programmer takes on is to read code. The ability to read, analyze and write good code is the most important skill that a programmer could hope to harness.
Readability is crucial. More crucial than you might think. Why? Well, for starters, anyone maintaining your code should be able to understand and do any required editing without having to resort to aspirin! Seriously though. As John Woods emphasizes, always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live. Yikes.
Well, think of it this way. Imagine that you have a hobby project. You expect no one else to take a look at it. You have it in a nice private github repository and it’s been sitting there for a good 12 months. Suddenly you feel like having another go at it, just for old times sake. Now you’re up to your elbows in code and trying to figure out what you’ve been doing. Would you understand your own code ? Readability is important.
Let’s look at it from another perspective. What would you do if you wanted to write selling poems? You’d be hunting down and reading good poems of course! Same goes for programming. If you want to write good code, you need to read good code. You can’t expect to see great results if you’ve never bothered to read good code from day one. Try to make it a little better and step up with each passing day. Always ask for more time for refactoring.
It’s best to start reading good code while you still have the time to do so. If you are an undergraduate, college student or a young enthusiast, then reading good code is the best way to get your career off the ground. Good luck! You can even try and contribute to open source projects to understand more, get free code reviews and get the hang of it.
Want to start reading good code ? Start with the following:
Code you should read:
- Django source code – Python
- requests – Python
- flask – Python (app.py is a bloated however)
- JUnit source code – Java
- LeafPic – Java/Android
- JSON.NET – C#
- Haskell Read List – Haskell
- Chromium – C++
- Qt Source Code – C++ (One of the most beautiful code I’ve read)
- Rosetta Code – Lot of languages
Books you should read:
- Clean Code
- Code Complete 2
- Pragmatic Programmer
Like what you see? Subscribe to our email list and hit us with a like on our Facebook page to get the latest news updates and tutorials straight to your newsfeed!