I really feel like drupal is a great example of the average php programmers way of thinking... Why has no one built a robust cms ontop of cakephp that's gotten popular? Cakephp is the closest you can get to developing on rails for PHP (which is a good thing) It's always on my list of things to do but I get sidetracked with shit that makes me $...
Despite being a "content management framework", the core doesn't actually save you from writing code. You still have to write CRUD code, still have to manage validation, still have to define your own themables. That is, unless you use CCK/Views, which is pretty much developer-hostile lasagna and slow to boot. And it'll look like ass, unless you have an ubertalented designer who also knows PHP (i.e. a "themer", a role which doesn't exist elsewhere). And the one part that you would actually want to contextualize, i.e. the content UI, is shoehorned into the node/edit form with zero choice.
Despite the promises of the hook system, Drupal lacks the ability to swap out components. If you wish to leverage part of the page generation process for another purpose, you have to reimplement everything that comes after. Alter hooks are terrible tools for building reliable behavior, since they require you to actively fight against other parts of the system instead of just turning them off. If you don't share Drupal's assumptions about user accounts, you're fucked, unless you feel like trapping and erasing UI messages is a productive use of your time. And don't even try to maintain the resulting code.
Despite being billed as having a "solid core", Drupal's irreplaceable innards are actually pretty fragile. Form API is near impossible to debug and fails silently at the drop of a hat. The node system doesn't even let you reliably do programmatic saves. The user system is a terrible misdesign that mixes front-end presentation details ($category) with low level data manipulation. The global $user object is actually a useless fake, waiting to trip you up.
Entire portions of Drupal were created in a theoretical vacuum and released without any serious working implementations. For example, install profiles: they are executed in an incomplete pseudo-Drupal environment where it's actually impossible to do certain simple things due to static caches and dysfunctional APIs. Another example: Form API process functions with complex datatypes and dynamic AJAX manipulation. Theoretically possible, practically a nightmare.
The problem can be summarized quite effectively: out of the box, it is impossible to make a slick, modern website with Drupal, i.e. something that looks and feels like 2011 rather than 2001. It's only useful if you're already planning to write a lot of custom PHP/HTML/CSS. Otherwise you have to be happy with terribly designed contrib components that are insecure, don't scale and have bad usability. This is not surprising since Drupal has been in incremental-improvements-mode since 2002 (i.e. Drupal 4.0) and the few architectural improvements made since then were designed with only one purpose in mind: to support what Drupal already does, rather than being solid components of a CMF.
Doing Drupal will stunt you as a developer, overburden you as a designer and frustrate you as a user.
Hey, it's Steven! Thanks for that. Here are a few responses:
unless you use CCK/Views
That is pretty much a given. In fact, CCK is even part of core in D7. Commenting on Drupal sans-CCK/Views is sort of like commenting on a car without its tires (bad analogy, I know).
which is pretty much developer-hostile lasagna and slow to boot
The first part is vague and the second part screams for benchmarks.
And it'll look like ass, unless you have an ubertalented designer who also knows PHP
Is this really so different than every other system? WP requires themers know PHP to do anything useful in a theme. ExpressionEngine uses its templating system which is basically just a different looking version of PHP. I'd be interested to see what you think is so different about Drupal here.
And the one part that you would actually want to contextualize, i.e. the content UI, is shoehorned into the node/edit form with zero choice.
Not really sure what you mean here, but if you're just saying that it's difficult to customize the node's output, then you might checkout the contemplate or display suite modules.
Despite the promises of the hook system, Drupal lacks the ability to swap out components. If you wish to leverage part of the page generation process for another purpose, you have to reimplement everything that comes after.
This is a legit point.
Alter hooks are terrible tools for building reliable behavior, since they require you to actively fight against other parts of the system instead of just turning them off.
What's the difference? You can turn things off with alter hooks. What's an example of a system that has a preferable behavior here in regards to overriding core behavior?
Form API is near impossible to debug and fails silently at the drop of a hat.
This is just an opinion. I've never had much trouble with FAPI.
The node system doesn't even let you reliably do programmatic saves.
Same as above; I've never had trouble with node_load() and node_save().
The user system is a terrible misdesign that mixes front-end presentation details ($category) with low level data manipulation.
This sounds like a nitpick to me. Does this really affect your programming or make any difference in your day to day work? Or does it just bother you on principle?
The global $user object is actually a useless fake, waiting to trip you up.
I'd be interested in more details here too. For example, it's fairly common to grab the uid from global $user, and I've never really hard any complaints about global $user before now.
install profiles: they are executed in an incomplete pseudo-Drupal environment where it's actually impossible to do certain simple things due to static caches and dysfunctional APIs.
Certain things like what? I only have a small amount of experience with install profiles, so this is a curiosity question.
Form API process functions with complex datatypes and dynamic AJAX manipulation. Theoretically possible, practically a nightmare.
I'll agree here. That said, D7 has made some huge strides in improving the AJAX DX.
out of the box, it is impossible to make a slick, modern website with Drupal, i.e. something that looks and feels like 2011 rather than 2001. It's only useful if you're already planning to write a lot of custom PHP/HTML/CSS.
By "out of the box" do you mean without any contrib modules? If so, then I'd agree, but that's sort of beside the point. You're supposed to take advantage of contrib modules, that's sort of the beauty of Drupal. And as for requiring a lot of PHP/HTML/CSS, I'd say that HTML/CSS is pretty commonplace in any CMS, and the PHP really just depends on the use case (you can do many many crazy things with Drupal/contrib modules without any custom code at all).
Thanks for that well thought out and well written post. It's well to see such a well reasoned critique of anything, including Drupal.
That is pretty much a given. In fact, CCK is even part of core in D7. Commenting on Drupal sans-CCK/Views is sort of like commenting on a car without its tires (bad analogy, I know).
CCK is only good if the UI provided by CCK suffices. If it doesn't, then the added hassle of having to deal with procedurally generated objects, types and tables quickly becomes a nightmare. I've found it much, much easier to just write a simple ORM mapper and do the rest myself, and not for lack of trying either.
It's not just me who goes without it: the Ægir hostmaster system that stores all its data in node types also chooses not to use CCK. Go look at the people who made that and tell me they don't know Drupal.
Incidentally, you're talking to UID 10 on Drupal.org. Long story.
The first part is vague and the second part screams for benchmarks.
You must be unaware of the layers of indirection that are taking place here. Also, views is terrible on the inside. It's a nightmare of handlers, plug-ins and uncaught errors waiting to happen. There's also the fact that using Views requires you to structure your code very differently and in a remarkably un-drupal-like way. For example, you cannot ship views templates inside an associated module's directory (unlike regular templates), they have to go in a theme. Unless you implement hook_theme_registry_alter() to undo it, yay.
My latest Views project was trying to hook up an external data source to Views 3. It's absolutely terrible and that's with example code to model it off (apachesolr).
Is this really so different than every other system? WP requires themers know PHP to do anything useful in a theme. ExpressionEngine uses its templating system which is basically just a different looking version of PHP. I'd be interested to see what you think is so different about Drupal here.
How do I get rid of the colon after form field labels? The answer is not to tweak a template of HTML-with-sprinkles but to dive into hardcore PHP code. Shall we mention theme('table')? Or perhaps the $node->content array of doom?
Not really sure what you mean here, but if you're just saying that it's difficult to customize the node's output, then you might checkout the contemplate or display suite modules.
Actually I meant the node editing form. It's the most basic part of a CMS, and Drupal sucks at it. Vertical tabs or not, the idea that everyone should edit all sorts of content through the exact same UI is madness. It also ignores the fact that you don't create an end-user oriented UI by hiding parts of the developer-oriented UI and calling it a day.
What's the difference? You can turn things off with alter hooks. What's an example of a system that has a preferable behavior here in regards to overriding core behavior?
The proper answer is to use inheritance to override behaviour rather than to undo it, e.g. using MVC to separate concerns and OO to allow for selective code modification.
Go and try to make it so that people can log-in with their e-mail address instead of their username. I'll wait while you figure out how to get rid of the error messages that no longer make sense.
Or perhaps you would like to replace the godawful password recovery page with one that actually looks like something a real web service might use? Unfortunately, the code that verifies the security hash is intricately tied with the part that displays the UI so your only option is to menu_alter out the entire page and reimplement it.
This is just an opinion. I've never had much trouble with FAPI.
Have you ever defined a custom element type? Used #after_build or #process functions? Used #ahah/#ajax? And done so without ever encountering a random type error deep inside form.inc? The menu system suffers from the same affliction: if you accidentally forget the array() around the 'access arguments' for example, you'll end up with some cryptic error deep inside menu.inc. The only way to debug these errors is to insert trapping code at the reported location, which incidentally is a whole cache refresh and page request later than the offending bug.
Fact is, Form API is undocumented and untested for the things it was supposedly designed to do. Do you know the rules around form caching and $form_state['storage']? When $form['#cache'] is needed? Or that your form element IDs will get broken if you trigger a form rebuild inside a page request? Yay. Still broken as far as I know.
Same as above; I've never had trouble with node_load() and node_save().
This sounds like a nitpick to me. Does this really affect your programming or make any difference in your day to day work? Or does it just bother you on principle?
Have you looked at the signature for user_save()? You cannot simultaneously modify two properties that are situated on different user profile tabs. By design. If you do any work with hook_user(), this will bite you in the ass. User objects are also unique in Drupal in that they will store custom properties for free. Incidentally, this has lead to many contrib modules polluting the users table because they don't expect it. Like the legal.module, which pushed the entire terms of service into every single row in the table.
I'd be interested in more details here too. For example, it's fairly common to grab the uid from global $user, and I've never really hard any complaints about global $user before now.
Passing the global $user object into user_save() will result in data loss if you have any modules that extend the user object. Simple as that.
Certain things like what? I only have a small amount of experience with install profiles, so this is a curiosity question.
Just one example. There are many, because of how much of a clusterfuck install.inc is. It tricks Drupal into thinking it's already installed to bootstrap it, and then pretends nothing's wrong when it installs all your modules and themes (which then fails when they do anything complicated on install).
You're supposed to take advantage of contrib modules, that's sort of the beauty of Drupal.
Except for the part where they are insecure and have terrible usability. Like for example the Single Sign-On module, an authentication module that let you steal UID 1 access from an admin with a single click. Or the Services module, where an elaborate fix for a reported security issue was itself insecure and spoofable. If you look at the security reports for Contrib, you find that they are the same vulnerabilities over and over again, in different modules, over several years. People are not writing better modules.
I have yet to encounter a situation where I can actually drop in a contrib module and have it satisfy my professional requirements. It just doesn't happen. I have to review their security, fix the interaction flow, get a designer to make it actually nice... and that's assuming there isn't some DB-server-destroying query in there.
If I have to audit every single contrib module I want to use, and the reward is a module that's kinda crappy anyway, I'll pass. It's just not worth it.
I get your point, but Ægir is nothing like your typical Drupal site, and the typical best practices don't and shouldn't apply to that specific of an implementation.
Our reasons were maintainability, deployability and dependability.
I actually wouldnt recommend the use of CCK for anything other than prototyping, because it becomes nigh on impossible to provide a reliable upgrade path, even if you follow best practices
Ægir hostmaster system that stores all its data in node types also chooses not to use CCK. Go look at the people who made that and tell me they don't know Drupal.
I get your point, but Ægir is nothing like your typical Drupal site, and the typical best practices don't and shouldn't apply to that specific of an implementation.
How do I get rid of the colon after form field labels? The answer is not to tweak a template of HTML-with-sprinkles but to dive into hardcore PHP code. Shall we mention theme('table')? Or perhaps the $node->content array of doom?
You're picking out the bad parts and ignoring the good parts. Every system has seemingly simple things that end up being complicated, Drupal is no different.
the idea that everyone should edit all sorts of content through the exact same UI is madness.
It may be, but it's the standard. WP, Django, ExpressionEngine, Joomla, all have a one-size-fits-all content-editing UI.
Or perhaps you would like to replace the godawful password recovery page with one that actually looks like something a real web service might use?
Why can't this be done by theming/blocks/whatever? What exactly would you want to do to that page that isn't easy?
Except for the part where they are insecure and have terrible usability.
This is a risk you take when you use community code. Again, it's no different in WP plugins, EE modules/extensions, etc. In fact, I've found the quality in Drupal to be above par.
I have yet to encounter a situation where I can actually drop in a contrib module and have it satisfy my professional requirements.
If that's true (never? really? not even the tiny do-almost-nothing modules?) then your standards are irregularly high, and hundreds of thousands of sites have been built by devs who used contrib modules and didn't feel the same, yet had no major issues.
You obviously haven't ever seen Joomla's module repository then. In general, Drupal modules are fairly well written, as they use the tools provided by core to write reasonably secure code.
0
u/midri Jan 05 '11
I really feel like drupal is a great example of the average php programmers way of thinking... Why has no one built a robust cms ontop of cakephp that's gotten popular? Cakephp is the closest you can get to developing on rails for PHP (which is a good thing) It's always on my list of things to do but I get sidetracked with shit that makes me $...