Drupal 'getting off the island' with version 8

The thoroughgoing overhaul of the internals of Drupal in version 8 of the web platform means the next release of the open source project may have taken longer than expected. However, the ability to more easily employ third-party libraries and the use of modern coding conventions will mean it's worth the wait, according to Angela Byron.

Byron is a Drupal core co-maintainer, the release maintainer for version 7 of the CMS and director of community development at Drupal services firm Acquia. Along with Harriet Wakelam, the head of customer experience at Medibank, Byron is a keynote speaker at the Melbourne Drupal South conference in March.

Drupal 8 is still in active development. "We shipped the first beta in October, right around the time of DrupalCon Europe in Amsterdam, and what we're trying to do at the moment is get our number of critical issues — release blocking issues — down to zero," Byron said.

"Once we do that, we'll start rolling release candidates and then finally release."

Currently Drupal.org lists 54 critical issues, down from around 120 at the time of the first Drupal 8 beta.

"We run Drupal on an 'it's ready when it's ready' thing — so basically we'll ship it when it's going to be stable and not kill people's websites. We're getting it more stable every day," Byron said.

The platform's re-architecture is the major reason why Drupal 8 is yet to be released, she added.

"Strategically we took an opportunity in Drupal — we call it 'getting off the island' or 'proudly found elsewhere' and some other monikers like that — to essentially pull our heads out of the silo that we're in with Drupal, which is easy to get into, and kind of look around and see what other PHP projects were doing and what other frameworks were doing and things like that," said Byron, who also known by her online moniker/Drupal committer username Webchick.

"The timing of Drupal 8 also coalesced with the timing of PHP having its renaissance, where we see a lot of frameworks starting to work together and share libraries with one another and developing shared standards. Things like coding standards, how to do class autoloading, some more nitty gritty things — ways in which we can easily share code among different frameworks and platforms so then we can each focus on the things we do best."

There was a strategic decision that, because the project is allowed to break backwards compatibility between major releases, to go "whole hog and catch up with everybody else and get the code base to the point where it's all object-oriented, and decoupled, and unit tested and all of these kinds of things, so that going forward, in later versions of Drupal 8, as well as Drupal 9 and 10 and so on, we never have to do this big re-architecture again".

"In fact because we have objected-oriented code now instead of all procedural global functions like we were using before, we actually have a lot of opportunity to continue to improve the internals of the software without actually affecting the APIs and the developers and modules and things like that," Byron added.

"That is the biggest reason that it's taking so long — because we decided not only to bite off some of the great features that are in Drupal 8 like WYSIWYG and in-place editing and configuration management and all these other things — but also try and do this fundamental re-architecture of this 13-year-old code base in the process."

Byron said that work on the next version of the platform has managed to significantly increase the number of contributors to Drupal's core.

"I think we're at one-and-a-half time the number of core contributors we had in Drupal 7 for the same amount of time," Byron said.

"There are a lot of people chomping at the bit to work with it [once it's released], but it does take a long time to move a code base that old to the new paradigms."

"It's interesting because we actually have Symfony as a model for this," Byron added.

(Drupal 8 employs a number of components from the Symfony2 PHP framework, including HttpFoundation and its YAML parser.)

"Symfony went through a similar transition between Symfony1 and Symfony2," Byron said.

"Symfony2 was a re-architecture built on standards like dependency injection and cleanly separated code and some of these other things. They saw a huge leap in the number of people who engaged with it after that point. Because when you write code in that way, you can actually write PHP code that doesn't make a Ruby developer gag all over themselves — or maybe that's a little strong! [But] it's a lot easier to approach though for people who come from any other language than PHP.

"If you look at any other language, they're all object-oriented, they all use import statements and things like that at the top of the file. When you open up a Drupal 8 file, it looks very similar to what you'd see in Java or .NET or Ruby or Python."

Some Drupal developers have been wary of the dramatic changes in version 8. Byron said that a significant portion of the developers contributing to Drupal 8 core have tended been younger developers or developers that have more recently learned PHP or come to Drupal from other frameworks.

"Those people get really excited about the new direction," Byron said. "Then I think you have another class of people and I would say I fall into this class of people — they tend to be older, they learned PHP ... in 2000/2001 when there was none of this object-oriented programming or anything like that. It was just all variables and we used GET parameters and horrible, horrible things back then...

"There's also a lot of people, and again I'm in this boat too, who not only have this historical knowledge of PHP from pre-object-oriented days and also have spent a tremendous amount of time building their Drupal knowledge and becoming experts in the platform. And those people are definitely nervous."

In one case resistance to the changes in Drupal 8 has led to a group forking Drupal 7 to create a new content-management system dubbed Backdrop.

"My view on [the change in Drupal 8] it is it is scary but on the other hand it's allowing me to learn — it's allowing me to grow as a developer and learn the things I should have probably learned seven or eight years ago but in an environment that I already understand," Byron said.

"In other worlds, I already know Views, and Nodes and Entities and what these weird words are that Drupal uses all the time. It's just about translating from the old way of doing things to the new way of doing things, and the new way of doing things actually has a lot of benefits."

Drupal 8 means the project can scrap some of the workarounds employed to deal with the past reliance on procedural coding, Byron said, such as Drupal's "ArrayPIs" — "arrays of arrays of arrays of arrays" — and "mystery meat" APIs that are not clearly documented.

"In Drupal 8 we have interfaces and [they] document 'this is the required part of the API, these are the arguments it expects, this is what it should return'. And it altogether is just a lot nicer and easier to parse," Byron said.

"I think the concern of the Backdrop type of folks is that they find the jump from what they know to fully object-oriented, dependency injected, waka waka code too intimidating to take all in one leap and they're concerned about that, so they're choosing not to make that jump — at least not yet," Byron said.

"I think that's a valid choice. But I guess in the meantime, Drupal's little island is growing smaller and smaller and smaller because pretty much the only framework that does procedural coding any more is Wordpress, which is a totally different thing from what we're building. "

"Everything in PHP is moving to packages and Composer and these decoupled libraries that are all running PSR-4," Byron said.

"I think the right choice was made regardless of how hard it is to make the leap, because that's frankly where everyone else is going. And if we want to play with everyone else in that pool — and I think we do because there are some fantastic libraries out there that we'd love to utilise — then it's the direction we have to go in to maintain currency."

Angela Byron is a keynote speaker at Drupal South in Melbourne, 5-7 March.

Follow Rohan on Twitter: @rohan_p


Copyright © 2015 IDG Communications, Inc.

Download: EMM vendor comparison chart 2019
Shop Tech Products at Amazon