Apart from writing clean code, here is another skill that makes you a great developer - It's the skill to read the code. Developers who are adept at both writing and reading code are likely to be more effective, versatile, and valuable in their roles.
Ask any developer what is the most important skill to have, they will mostly say it's "Writing the Code". Well, this is enough to get you started but to continue, you need to also have the ability to read the code.
Writing code is like writing a book. A lot of people are going to read it. So, write it well for others to read.
The next few points should help you understand why learning how to read code is paramount for developers at all levels.
Add a new feature
Any time you want to add a new feature or apply a bug fix, it's important you know where to make the change. For this, you should be able to read and understand the existing code.
If you put the correct code but in the wrong place, it's still the incorrect code.
Developers usually "spend" time to identify the correct place to make the change. There are various ways to figure out the right "place" like adding console statements, debugging the code etc.
If you are good at reading the code and understanding it, the time to identify the "right" place will be minimal.
Code reviews are an important part of the software development process. Reviewing code is an extremely enjoyable process once you understand the benefits of it. If you are new to code review, please check out my detailed blog on how I do code reviews.
The Quality of code is measured in the number of what the hecks per hour"
If the change is minor and you are good at reading code, you can save time during code review just by reading the code and checking if the code does what it's supposed to do.
Mentoring Junior Developers
Oftentimes in our career, we work with developers who are less experienced than us and there are times when the juniors come & seek help. As a more experienced person, if you are good at reading the code written, you will be able to quickly look at what is happening and accordingly help your teammate.
We raise by
lifting othersfixing bugs of others!
Code never lies, comments sometimes can.
There are certain sections of the code, which are complex and developers tend to add comments. At times, the comments could be saying one thing but the actual code would be doing something else. This often happens with legacy code bases that have been around for decades.
Learning new things
Let's say you have been tasked to implement a new library, which you have not used before, most likely you are going to start reading the documentation and examples.
(Some people will just try their luck and copy-paste code and hope to make it work. No, it's not gonna help)
Read the damn manual
So, having the skill to read the documentation and understand the examples quickly, really helps with being productive.
High Severity tickets
Writing code and building temples are the same. First, we build, then we pray
If you ever worked with production issues, then I'm certain you are not a stranger to a high-pressure situation. These situations demand swift solutions. Guess what, your ability to quickly read and understand the code/issue could result in whether you save or lose a client/job.
For Developers, writing code is a fundamental skill. However, the ability to read and grasp code is equally essential. Reading the code helps a lot during debugging, code review, mentoring, learning, and maintenance. Developers who are adept at both writing and reading code are likely to be more effective, versatile, and valuable in their roles, contributing positively to the quality and success of the product being built.
If you have reached so far, congratulations. Please feel free to share your thoughts via the comments.
Until Next time!
Did you find this article valuable?
Support Sandeep Gokhale by becoming a sponsor. Any amount is appreciated!