Last updated 9 March 2012.

I know that this topic was discussed before, and not once. Yet if I would raise core initiative, it will be about backwards compatibility.
We love Drupal for the cool new stuff. Regretfully, this cool new stuff automatically marks old stuff, which we believed to be cool just yesterday, as outdated. This happens again and again, and there are already signs that Drupal 8 will not be an exception.
I fully understand that there are serious reasons for making changes in core that are not compatible with existing code. From the other hand, what's the use in brand new shining core, packed with blows and whistles, if it is not supported by contrib?
The wider adoption of Drupal will go, the worse the compatibility problem will become. Need to rewrite own custom code every 3 years or so can kill the small company, and force enterprise to choose more "stable" platform.
The question is, is it possible to innovate, but allow existing code to run even in the new environment?
If it is possible to have in D8 core optional compatibility layer, which will allow D7 modules to work as if they are in D7 core? For sites built from scratch for D8, this will not have any overhead, but make upgrade path much smoother.
Compatibility layer could, for example, rely on PHP 5.3 namespaces. Let's say, D8 code resides in Drupal8 namespace, and compatibility code in D7 namespace. Benefit: it is possible to have functions with the same name, but different parameter sets. Yes, it requires PHP5.3, but many distribution vendors have already dropped support for earlier version, and it is much easier to upgrade PHP, than to rewrite tons of existing code.
Of course, this could be tricky, but... aren't tricky things cool?


chx’s picture

This is not possible. There is a lot more than namespacing here. Help with making the super tighlty coupled core to be more loosely coupled than we can try. Until then, this is hopeless.

Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

valthebald’s picture

Of course, namespaces solve only one problem. Let me ask the question differently: what is the set of conditions, under which current hopeless situation can bring some hope? I think that defining that set of conditions, is by itself important target. My post is about problem, not some magical solution. And being end (not core) developer, I find this problem very important.

valthebald’s picture

I see that namespaces mention is confusing too many people. Please don't get me wrong: my post is about changing drupal architecture in the way, that will allow old code to run on newer cores. How to do this: with or without namespaces, which structure should have compatibility layer - I don't know. Namespaces is just my suggestion on specific problem of function naming. Compatibility layer has to solve much wider set of problems.

Michelle’s picture

This seems more like a question than an initiative... I'm wondering if it should be moved elsewhere? Or make a section for "initiative wishlists"? If I'm misreading, I apologize, but it sounds more like a "would be nice" than an "I'm going to lead the attack on..."


valthebald’s picture

initiative wishlist could be, indeed, a better place. From the other hand, if other people feel like myself, there could be easy transition from "would be nice" to "I would fix that (with others)". Frankly, I don't feel strong enough to lead such a step.

valthebald’s picture