Drupal coding standards are rules about how to format PHP, JavaScript, CSS, and YAML code in Drupal projects. They ensure consistency across core, contrib, and custom code.
The standards cover indentation, naming conventions, comment formatting, and more. For PHP, they mostly follow PSR-12 with some Drupal specific additions.
Enforce them with tools like PHP_CodeSniffer configured with the Drupal coding standards ruleset. Most IDEs can run the checker automatically and highlight violations as you type. Automated tools like PHPStan also catch common bugs and type errors that standards alone miss. Following coding standards makes your code easier for other developers to read and contribute to. It also makes it more likely that your contributions to core or contrib will be accepted. Set them up from day one of any project.