Updated on 10 October 2017
[ This section needs to be completed, see the project roadmap for this site. ]
Why your code turns to pasta and what to do about it
Use contrib and custom directories
Place contributed modules and themes in a contrib directory: /modules/contrib and /themes/contrib.
Do the same for custom ones: /modules/custom and /themes/custom.
Changing this when your site is already in production will be harder than adopting the right standard when starting your project.
This is already handled by default by the Composer template for Drupal project.
If you use your own composer.json file, just add this to the extra section (where web is your docroot directory).
Check your logs
During development, it is a good habit to frequently have a look at the recent logs (/admin/.
You will not want to have errors like undefined variables to be logged and mixed with other system messages (nodes created, deleted, ...).
Use a debugger
Use a tool like Xdebug that you can configure on your IDE.
Use Drupal coding standards
Favor dependency injection when using services in an object
Dependency injection is the preferred method for accessing and using services in Drupal 8 and should be used whenever possible. Rather than calling out to the global services container, services are instead passed as arguments to a constructor or injected via setter methods. Many of the controller and plugin classes provided by modules in core make use of this pattern and serve as a good resource for seeing it in action.