Be consistent

Whether you prefer strict code or not, use snake-case or camel-case for variable names or how you write your test methods, it is important to be consistent in how code is written.

If you're working in a file that uses snake-case variable names, you should do the same and follow the same conventions.

When reading a file, everything should be consistent and seem like it was written by the same person following the same approaches.

Otherwise, when you need to add to or refactor this code in the future, it will be harder to do so.

Consistency is key.

- 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 Acquia-certified Drupal Triple Expert with 17 years of experience, an open-source software maintainer and Drupal core contributor, public speaker, live streamer, and host of the Beyond Blocks podcast.