If I had to use one word to describe Drupal 8 compared to previous versions, it would be: order. This sense of order comes with both obvious and subtle changes to how we think about Drupal development. Here are some of my initial impressions.
Classes
The adoption of classes in Drupal 8 brings significant changes. Most noticeably, we can no longer directly modify data as we could before. Instead, we interact with data through class methods, moving away from simple arrays where we set and read keys freely. Render arrays remain an exception, but their scope and purpose have become more clearly defined, which is a welcome improvement.
One major advantage of using classes is that Drupal 8 is now more compatible with unit testing. While unit testing was possible in previous versions, it often felt awkward and went against the grain of Drupal's structure. With classes, testing becomes more streamlined and intuitive.
Services
Service containers are another powerful addition in Drupal 8. They allow us to access needed data more efficiently, without the convolutions previously necessary in Drupal. By simply calling on the appropriate service, we can access data as needed.
That said, locating the right service can be a bit tedious at first, but this should improve over time as we become more familiar with the service system. Moreover, services enhance unit testing, as we can substitute services with mock versions to control testing conditions. This capability allows us to create more reliable tests with known data and predictable results.
Twig Templating
I absolutely love Twig. PHP as a templating language is often clunky and difficult to read. In Drupal 7, it was not uncommon to find PHP logic directly embedded in templates—a practice that complicates both readability and maintenance.
With Twig, the separation of logic and presentation is enforced. Templates only receive the necessary data, and explicit logic is minimized, making templates cleaner and easier to maintain. Additionally, Twig filters are defined outside of template files, promoting a clear separation of concerns, which benefits both designers and developers. In my view, Twig is one of the best new features in Drupal 8.
Conclusion
Drupal 8 requires a bit of a mental shift, but overall, it feels like a tremendous step forward. The order and hierarchy in Drupal 8 help developers understand not only other people’s code but even their own past work, as there are now fewer ways to accomplish the same task. This improvement makes maintaining codebases more efficient.
Finally, the choice to build on the Symfony framework is brilliant, as it allows Symfony developers to transition into Drupal development with greater ease. This increased accessibility benefits the Drupal community by encouraging wider adoption and collaboration.