Drupal Versus CakePHP
Although Drupal is generally considered a CMS rather than a web application framework, there’s a fair bit of overlap in either regard, which I guess excuses the fact that I’ve been using it as such. At my current job with Eyemart Express where I work as one of two(!) software developers for a company that really requires somewhere near 20, I work a lot with CakePHP because, quite frankly, it was the first framework I could think of when the two of us met and started discussing rebuilding the company’s archaic website.
Simultaneously, I’ve also been working on a website for the National Dodgeball League to aid in building a more central community for the world of dodgeball. It’s supposed to encompass leagues, teams, and events (which also includes registration, management, and liberal use of the PayPal API). Oh, and the commissioner wants to incorporate a hefty bit of social shenanigans in there as well such as badges, following teams and players, and that sort of thing. After a bit of discussion with them, we settled on using Drupal for the project.
Though I’ve used both of these frameworks before, working with them in parallel with two different frameworks has given me more insight on what I like, don’t like, and want to wish into a corporeal form so I can burn it back into nonexistence.
CakePHP
I really like CakePHP. I mean, it may just be because it’s based in the model-view-controller architecture, but it makes a lot of sense to me and makes development extremely easy. All of your different pages go into the views (including your “theme,” so to say), your database interactions go into the models, and your user interaction logic goes into the controllers. Simple!
Everything is named as they need to be, too. In CakePHP’s effort to enforce “convention over configuration,” everything is named according to what it does, like the controller for frames is called “frames_controller.php” and its index page is in the /views/frames directory under “index.ctp.” Just about everything is automated if you name things right including table usage, authentication, and more. And even though I don’t use it, CakePHP provides a command line utility that “bakes” things automatically for you after you provide some basic parameters.
I also really appreciate how little overhead there is with CakePHP. In fact, after installation, there are no database table created and comes in at somewhere around 6MB, most of which is located in the /cake directory. The only real problems I can point out are that your models may get a bit unwiedly with more complex applications—though if you get to an unbearable size, you’re probably doing something wrong anyways—and the amount of plugins pales severely in comparison to the amount of Drupal modules available.
Drupal
Speaking of Drupal, I’ve got some beef to pick with you. Sure, the community and the modules are pretty nice, but picking through the trash to find the gold (and sometimes nothing more than shined-up pebbles) is incredibly arduous and you never truly know if something is worth using until you install, configure, and use it. This is really just a problem that comes up with the feature as I’m sure CakePHP would have a similar problem if it had anywhere near the amount of plugins available, but a problem nonetheless.
There is also an incredibly harsh learning curve for Drupal. Had I not been pinned into using it from early on, I probably would have turned back to CakePHP for the NDL project. Many things are explained in the “how to do this” fashion with the documentation and tutorials on the Drupal website, but few (if any) are explained with the “why this happens.” A prime example is how to get the theme hook to work properly (the comments spell out perfectly the effectiveness of Drupal documentation).
I jumped right into developing my own modules since I figured it would not only help with my Drupal education but also the level of customization with the site, but my initial roadblock was trying to figure out how to get a theme file to render. For the longest time, I was only getting a blank white page to show up along with whatever desperate debug statement I was outputting to reassure myself I wasn’t going crazy. After pouring through other modules, I realized you not only had to register with the theme hook/manager for your whole Drupal system in your .module file, but you also had to still make a call to drupal_render with either a function that produced an array-based, HTML-esque data structure or a .tpl.php file (or both!).
Oh, also, you have to go to the modules page in the admin panel to clear out the module cache, something not mentioned anywhere(?) in the documentation and a fact I only found out after close to an hour of angry Googling. It’s a common theme for things to be documented enough for you to know about something, but not about the underlying logic for that thing, resulting in a lot of searching the web and looking at other modules for answers, though I guess it’s hard to document everything when your system is that large.
In fact, I would downright call Drupal bloated. Though many things are set up right away after installation such as users, roles, permissions, nodes, and such, which is very nice indeed and greatly appreciated when you’re so used to doing most of those things yourself, but the installation itself sticks in 55 tables into your database. And while the actual size of the files included in the installation are quite svelte at under 4.5MB, it’s very easy for your .module files to get out of hand. Breaking out into .inc files, theme files, and other sub-modules is pretty much the only way to wrangle these file sizes and line counts into anything close to resembling manageable, otherwise everything gets jumbled together—a stark contrast to the MVC methodology.
With all the mishmash of information, logic, and layout data coming from every which way, it’s also predictably somewhat of a chore to develop themes. In fact, the recommended method of making themes and not just learning to do so is to simply modify one that already exists. The default theme itself is also quite a mixed bag of quality; while I really enjoy the blue tones and the fancy breadcrumb situation going on up top, the way forms and profiles are, dare I say, horrendous.
And Finally
That all being said, though, CakePHP doesn’t even come with a default theme let alone a built-in theming or templating system, though the views part of the whole MVC thing kind of takes care of that. Also, despite all the gripes I have with Drupal including its bloat, its learning curve, its comprehensive-yet-disturbingly-lacking documentation, and the myriad of other things I could point out that make me grumpy, I can tell that Drupal was a good choice for the NDL project. Maybe it’s a bit of Stockholm Syndrome, but I’ve grown oddly fond of Drupal’s oddities, some of which point to the fact that it may be more convoluted for a reason: it’s more powerful. So many things are built-in and yet so many other things are left out for a reason; the developers know what is and what isn’t important and what can lend to a more versatile framework.
That’s not to say, however, that I prefer it over CakePHP whose baseness and simplicity are just too much for me to overlook. Even though there are many things I have to handroll in CakePHP compared to Drupal (such as user stuff), I just love the straightforward MVC architecture. If I want to change how something looks, I go the /views; if I want to change how something works, I got to /controllers; and if I want to change how data is stored or retrieved, I go to /models. If only everything in life could be so simple.
cake php is better
Cake php better? … I honestly don’t understand these debates. You are comparing apples to oranges. Most make their assessment on ease of use, which generally means these same people never needed a tool for anything other than something simple.
Which is better a fighter jet or a bicycle? Well, you can clearly do more and go farther with the fighter jet, but of course there is a higher learning curve.
A higher learning curve is not a bad thing, it is a sign of FEATURES, just like the fighter jet.
The only thing that can even hold a candle to Drupal is Ruby on Rails – not WordPress, Joomla, CakePHP, Concrete 5 or anything else.
If you want easy go with the bicycle, but when you do don’t say it is better than the fighter jet – because it isn’t
p.s. to correct Luka – Drupal IS a Content Management FRAMEWORK – NOT a CMS. You use Drupal to produce your own CMS’s. Another assessment people consistently get wrong.
Excellent analogy! But the point is that both the jet and the bicycle are methods of transportation, and—given that I make the concession in the first sentence that Drupal and CakePHP are vastly different—I found CakePHP to be what I needed at the time, not better in absolute, discrete terms. For this particular project, I only needed to travel a couple blocks. Although it would be incredibly interesting, I don’t think anyone would find that a jet would be necessary for that distance.
And thanks for reading!
I’m sure the fighter jet has its uses, but a bicycle is far more practical (yes – I’m directly referring to your analogy). You don’t need a runway, no fuel, cheaper to own (effort/learning curve), and can use it in almost all situations – even if it is more work. Most importantly, when the bicycle breaks, its easy to fix. Try fixing your fighter jet yourself
Great article…
Oddly there are just few comments… I prefer CakePHP because I love to know how things work, I like to develop them and so on… I can understand why someone might like Drupal, though… once you get how it works – of course
Another thing worth mentioning twice:
CakePHP is a development framework based on MVC paradigm.
Drupal (just like Joomla) is a CMS (leaning towards framework)…
This means that Drupal might have also be built on top of CakePHP…
Thanks! And same here. Understanding the order in which things happen with Cake is so much simpler and more intuitive than with Drupal.
What do you use to develop your own website?
This blog is actually WordPress, but for just about everything else, I use Cake. I made http://www.arushdball.com/ with Cake and I think it turned out pretty well.
Have you tried Croogo?
It’s a small ‘CMS’ built on top of CakePHP. Feature wise, it’s not comparable to drupal. It provides a basic set of functionalities, but you could use cakephp plugins on it. And if you’re already familiar with cakephp, extending it should be relatively easy.
If you’re feeling ‘brave’, take a look at the 1.5 branch in https://github.com/croogo/croogo/tree/1.5 (which is under heavy development).
this was the first article i read when i learnt that there was something called cakePHP.
im a commerce guy, never into engineering. but after my college, i went for a short term course on embedded programming which indeed had a great impact (well, i had a good teacher).
during that time i was an avid blogger and had about 83 blogs in blogger..
as you kno, blogger is more of a design stuff.. not really told the user on what is happening in the background..
so after my embedded course, i started 8051 programming for about 6 months.. that showed me what is happening in the back.
then my friend wanted a site for his team, and introduced me to drupal..
a few intro videos, kicked me off with drupal..
i realized drupal is just like blogger but with more awesome features like showing a content on a particular page, who can access it, login destinations, it was pretty cool..
though as mentioned in the article, searching and choosing the right module is a bit of pain, but its worth the results you get..
im not sure if you are aware, but you can generate custom themes with artisteer (for static websites though)…
i use it..
and if you know the way around, you can make it work for a dynamic site.
as time progressed, i chose to do IT in my MBA specialization.. yea, a commerce guy doing IT masters..
part of my project was erp implementation for my dept…. i started of with drupal but couldnt customize it..
it was then i started goin to the core of it..
w3schools gave me the basic syntax of php, me and my frnd designed an entire erp system.
so now its like, im slowly moving from the bicycle to the jet..
i was searching for jobs in a leading game development site, and i came across cakephp..
i then went to that site, and tried the demo..
kinda good… and reading your review, i just developed a liking for that framework..
however, i think i’ll stick with drupal considering my exposure in using and customizing drupal 7..
this is only because, being a non IT guy, understanding how things work is, at times, a tough task and breaks my head with hours of googling..
but i wanted to thank you for this article, because it showed me where i stand right now
if you think you have any resources to help me, reach me @ facebook.com/naidhro
Wow, thanks so much for this comment! It really warms my heart.
And I totally what you mean going from a bike to a jet. It certainly is a rush when everything starts to click.
Yeah, Drupal is really neat and powerful. I just really prefer the barebones mentality of CakePHP and other similar frameworks over a fully formed CMS like Drupal.
I actually work in a Drupal shop called ActiveLAMP, have been for a little under a year. I have to say that although I love Drupal, I have a preference for CakePHP, but that’s ONLY because of it as a tool. Drupal is a great tool if you just want to download it and start plugging away at theming, maybe make a module or two for some extra stuff. And I LOVE Cake. I’m a huge fan of the .NET framework and it’s MVC library, so I really appreciate the kind of things you get out of MVC (Type assurance, partials, automatic crud scaffolding, and the concept of separation), and Cake just does an amazing job at this. I really enjoy the article two, because I’m hoping to give a presentation pretty soon at my work and hopefully get some stuff going in cake, and I think this article really helped me thing about some discussion points.
However, I really have to agree with Justin. Drupal is freaking powerful. It’s got an a whole caching concept, a sort of infinitely expanding object model (well rather, customizable object model via adding entities and such), and it takes care of a lot of things for you like content management abilities and such, and a module / theme system that almost seems like a computer science 500 class project offered at Universities. But I don’t really know if you can compare that to Cake. Cake is a very open model, it lets you build on top of Cake. Drupal is something that you sort of build within it’s infinitely growing range of capability. However, the debate you have is done well, kudos! If you ever need a fellow cakePHP-er, feel free to get ahold of me!
I love this blog posts, it expresses my feelings exactly when i was trying to learn Joomla. I had to learn Joomla for work, I had 0 experience with CMS. It was so difficult to find out how things work with Joomla. I attend several user group meetings and watched tons of videos. 99% of the information out there is using themes, installing plugin etc. It was so hard to write anything custom.
I work for a design studio and it had to look a certain way no exception. We hired a freelancer who frankly wasn’t good. It was so frustrating. I bulldozer my code into the site to get it to do what I wanted but the site was very heavy. I still haven’t mastered Joomla but the ways I had to “hack” into joomla to do what I want has waned my interests.
I started learning cakePhp and I hope this will show me the light of building CMS sites with full control.
http://groupspaces.com/rapidrenders/pages/bestwonderstore
What’s up everyone, it’s my first visit at this web site, and article is actually
fruitful in support of me, keep up posting such posts.
Fastidious answer back in return of this difficulty with firm arguments and describing the whole
thing about that.
I am really glad to glance at this web site posts which consists of tons of helpful data, thanks for providing such data.
The attackers cut open a fence and then shot up transformers,
apparently targeting specific pieces of equipment.