Get Good At Reading Code

"Debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?" - Kernighan's Law

So much about the practice of software engineering revolves around building software that we can read and understand. Unless you're just creating a quick script or throwaway tool, the readability of your code is important. Additionally, in most professional situations you need to not just be able to read your own code, but code written by others.

While many software engineers like to think of productivity as involving lots of code writing the reality is that fixing bugs and adding new features often involves a lot of code reading before anything can be added or changed (or, if you're lucky, removed). You need to get good at following the flow of functionality, executing code in your head, and building mental models of the system you're working with based on that reading. It can help to do more "active" reading, which might involve actually running the code and writing things down as you explore.

Reading code is also a core part of doing code reviews. If you can't read and understand someone else's code it's impossible to give good feedback and spot potential issues. Just as reading more books can increase your reading comprehension of prose, reading lots of code increases your software reading comprehension, so reviewing code can be a great way to improve your code reading skills.

As we see the use of AI generated code increase, the human skill of reading code becomes even more important. Code reading is a foundational skill that will always pay off (and be sure to consider your fellow reader as you write your code).