Blog

Alexander Bird Software • Blog

Learning to build useful, valuable software as part of a team.
About

Getting Better At Writing Code For Readability

Some things that I have found helpful to grow in writing code for humans to read

I would suggest practising writing code to be more readable, and the best thing I can suggest for that is to get peer review. At work, whenever you can, get senior folks and peers to read your code and give you detailed feedback -- and take their feedback. If your coworkers don't give detailed reviews, you may find this blog post I wrote helpful for ways to get more feedback from them: The Active Code Reviewee.

When you write code that isn't confidential (maybe practice problems), consider submitting it for review at Code Review Stack Exchange -- focus on how you could improve your style, clarity, readability, etc..

In addition, you can do a code kata -- solve a practice problem many times (3 or more). Each time, you start from scratch -- either write the same code again, or (more likely) try some slight variation that solves the same problem in a new way. I've found I'll vary one thing or another until I get really comfortable with the problem and different possible solutions. This helps you to find different ways to express your thoughts in code. When you can write the same code many different ways, you'll be able to write code that really clearly expresses your intent.


Something to add? Continue the conversation on Twitter


Written 2021-04