Jump to the navigation menu

Don't add blank lines

I recently saw a social media post that said something like "Don't add blank lines within functions. They take up space and don't add anything".

I may have misremembered the exact wording, but that was the gist of it.

I like to add blank lines within my functions to create and add separation between logical blocks of code.

Whilst this doesn't add anything for a computer parsing and serving the code, or a CI pipeline performing checks, it makes the code easier for people to read and understand which, it my opinion, adds its own value - even if the functionality is the same.

- 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.