Code Standards: It's Okay to be Yourself, But Write Your Code Like Everyone Else


Imagine writing a book with a team of other people, but you're not following the same grammar and spelling rules. It would be really difficult. In writing prose, grammar and spelling are our standards. In writing code, we have standards as well. Following these rules helps us maintain code together.

Coding standards help us agree on the level of quality our code should meet. The Drupal community has a thorough and ever-evolving set of coding standards to keep our code readable and maintainable by developers around the world - this allows Drupal's open-source community to thrive all over the globe.

Even if you aren't contributing code back to Drupal (gasp!), and you think you are the only person who will ever see your code - you truly never know. Best practices exist for a reason, and you can never be sure where your code will end up, whether it will need to be scaled, or who will read it one day. Keep it standardized, and you'll never have to worry!

If you’re new to Drupal, this session is essential! If you want to want to brush up your knowledge and clean up your code, or make sure you're writing clean code in Drupal 8, this session is also for you.

You will learn the answers to some important questions, such as:

What are Code Standards?
Why should we follow Code Standards?
Why are they important?
What do they help us achieve?
Who decides Drupal’s Code Standards?
How do we implement them?

You will learn both formatting standards for your code and documentation standards, as well as some specifics for things like Twig, and object-oriented programming in Drupal 8.

You will learn how to implement these standards using tools like Coder and PHP Codesniffer, and how to make your editor do some of the work for you.

This session is appropriate for any level of Drupal experience, from beginner to expert.


Blog Posts that inspired this session:

Session Track

Coding and Development

Experience Level


Drupal Version

When & Where

Wednesday, 26 April, 2017 - 15:45 to 16:45
314 - Blackmesh