3 ms·
How is the codebase? OOP? MVC? Do they still use those weird file extensions (it was ".include" or ".module" maybe, don't remember now)?
by Tomek_ 16y ago
How is the codebase? OOP? MVC? Do they still use those weird file extensions (it was ".include" or ".module" maybe, don't remember now)?
- stdbrouw 16y agoThey've been slowly moving to a more object-oriented approach, but in general the consensus seems to be that procedural code and a very, ahem, loose separation between logic and views is just fine. See http://drupal.org/node/547518 http://drupal.org/node/547518 which makes some good points (Drupal uses a lot of patterns commonly found in object- and aspect-oriented code, even if it's neither) but also reads like a long apology for crummy software architecture. It's a mixed blessing, I think. OOP can be scary to people new to programming, and the PHP ecosystem has a lot of new programmers. On the other hand, I'm very, very glad I don't have to maintain the Drupal codebase.
- thinkingeric 16y agoThe 'us too' quality of that blog post is disturbing. They don't need to defend their architecture choices against people who naively assume that OO is an appropriate paradigm for all domains. The list of how 'design patterns' are really in there somewhere is particularly off-putting. I didn't like developing for Drupal, but I certainly support their right to do the things in the way they think is best for the problems they are trying to solve.
- kylemathews 16y agoDrupal is 10 years old so started back in the dark ages of PHP 3. So it started almost completely procedural but large chunks now have been converted to OOP. Drupal doesn't follow the MVC pattern but the somewhat less common PAC (Presentation-Abstraction-Control) pattern. See http://www.garfieldtech.com/blog/mvc-vs-pac http://www.garfieldtech.com/blog/mvc-vs-pac for a good overview of the differences between MVC and PAC and how Drupal implements it.
- kylemathews 16y agoAlso, the codebase is considerably more stable than at any point in the past due to a large push to add automated testing to Drupal core. There are now upwards of 25,000+ tests that run automatically on every contributed patch.