Why reading code is just as important as writing code: How to get better at it

Click for: original source

It strikes me as odd. We’ve heard the same messages: Write clean code. Write readable code. Write meaningful code. By Amy M Haddad.

Author agrees with these sentiments. But all the talk about writing code overshadows another critical skill: the ability to read it. Reading code is like an athlete who watches their game films. There’s a lot to gain when you become a vast reader.

What you will find in this article:

  • An Important skill
  • Reading vs. doing
  • Reading informs writing
  • Become a Better Reader
  • Follow Ben Franklin’s lead
    • Solve a problem.
    • Find a programmer who’s better than you and who’s solved the same problem.
    • Study their solution. This is a crucial step: read each line of code and type a comment in your editor to explain it.
    • Re-solve the same program after some time has passed. Use the comments you typed out as hints to guide you along the way.
  • Compare your program to the one you studied.
  • Solve problems on LeetCode
  • Recycle your own problems
  • Be a better programmer

Solving problems on the website LeetCode offers an important benefit: it provides in-depth solutions to problems. Oftentimes there are multiple solutions with explanations. A programmer does a lot of things. Writing code is one of them. So is reading it. In the end, being able to read code can help you to write it. It’s circular. Reading code matters and we ought to strive to get better at it. Good read!

[Read More]

Tags programming learning teams miscellaneous how-to