5 Make code readable

This chapter covers

  • Techniques for making code self-explanatory
  • Ensuring that details within the code are clear to others
  • Using language features for the right reasons

Readability is inherently a subjective thing, and it’s therefore hard to put a solid definition on exactly what it means. The essence of readability is ensuring that engineers can quickly and accurately understand what some code does. Actually achieving this often requires being empathetic and trying to imagine how things might be confusing or open to misinterpretation when seen from someone else’s point of view.

This chapter should provide a solid grounding in some of the most common and effective techniques for making code more readable. It’s worth remembering, ...

Get Good Code, Bad Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.