Jump to the navigation menu

Writing comments first

Something I often do before writing new code is to write out what it needs to do, either in a README file or as code comments.

It could be paragraphs of text explaining the problem I'm solving, or a short checklist of what the code needs to do.

This clarifies the situation and the approach and allows uncovering any potential questions or issues.

It takes time, but I can complete the task quicker as I've made the decisions and answered any questions upfront.

I'll either remove the comments as I write the code or, if they still add value, I'll keep them to add more context and information.

- Oliver

Was this interesting?

Sign up here and get more like this delivered straight to your inbox every day.

About me

Picture of Oliver

I'm an certified Drupal Triple Expert with 18 years of experience, a Drupal core contributor, public speaker, live streamer, and host of the Beyond Blocks podcast.