Home > PHP > Maybe I was too hard on CakePHP

Maybe I was too hard on CakePHP

December 23rd, 2008

After a few bloody noses and black-eye’s from my previous post “Four Reasons to Hate CakePHP“, I think I might have been a little too hard on the little guy. No, seriously, I really think I might have been a little to hard on it. After reading some of the feedback, and reading some counter points by Matt on his blog, “[point] 8 Reasons to Hate CakePHP“, It made me reconsider my post. My opinion remains the same, but now I realize my perspective is off. (I’d accept way off.)

The first thing I failed to consider is that one single tool is not an end-all solution to all problems. A fair argument has been made about Zend Framework — it’s not quite a framework in the traditional sense of things. CakePHP is exactly that; a framework. That is the essence of half of the problems that I and my colleagues have experienced when it comes time to scale. CakePHP provides a well structured framework (note: when I said structured before, I was referring to architecture, not file system structure) to quickly develop applications. (Do I discredit myself by saying that it’s very good at doing just that?) With CakePHP, you get an application that’s ready to go out of the box — not so much with Zend Framework. Zend Framework is largely a library, not a framework. This is, after all, why it’s able to stay out of your way so easily — it wasn’t intended to be there in the first place.

CakePHP is exactly that; a framework

The second thing that put me back in perspective is an article I recently read about how Zend Framework is “winning the wrong war”. (I apologize to the author, I can’t find your post to link to.) That posting makes a very good point. It talks about how Zend Framework strives to gain the approval of Ruby on Rails folk, but it’s going about it the wrong way. Zend Framework is riddled with extremely useful components, thorough testing, and great documentation (most of the time). The trouble is, most people just don’t care about any of that. Like that posting describes, most Ruby on Rails folk love RoR because of the little time to market required to get a conceived idea online. I’ll go ahead and admit: Time to market with CakePHP is much faster than Zend Framework.

CakePHP’s “weakness” (as I would have earlier described it) of being simple and concrete is where Zend Framework’s “strength” lies. Yes, with Zend Framework you can have an application online fairly quickly, but you don’t get anything out of the box. It provides all of the components needed, and recommends a file structure, but doesn’t require one. This allows you to pick and choose what you want Zend Framework to do for you. But this flexibility comes at the price of a learning curve, and at the price of extra bloat for those sites not in need of the hundreds of extra components that it provides.

To make up for my skewed perspective, I hope to write a few more posts in the coming days comparing and contrasting features of both frameworks. In the mean time, allow this follow up to serve as somewhat of a rebuttal :)

Share and Enjoy:
  • description
  • Digg
  • Reddit
  • Technorati
  • E-mail this story to a friend!

PHP

  1. December 23rd, 2008 at 14:23 | #1

    Hey A.J.
    Glad to see you weren’t insulted by my post. It was meant as a fun counterargument. I look forward to reading your stuff about Zend/Cake in the future.

    -Matt

  2. December 24th, 2008 at 00:35 | #2

    The main thing that developers need to remember is use what works best for the task at hand.
    When I work, we use Symfony, it does have many great aspects but is to resource intensive for my personal usage. The things I like about Zend is that I can easily build with a modular setup, it’s has many features and can work with phpDoctrine. The downside is that it is missing crud generation.
    In the past I’ve used Codeignitor which is great for a very quick and basic setup. I looked at cake in the past be believe it’s biggest downfall is being stuck on php4.

    Right now I’m looking at Django because it has the power of Symfony, but is extremely light weight. For more on Django you can checkout my two postings at slack5.com

  3. December 24th, 2008 at 00:35 | #3

    Aww, that should be ‘where I work’ not ‘When I work’ LOL

  4. December 24th, 2008 at 01:24 | #4

    Ahh, now that’s much better! Better phrasing, neutral points of view, good and concise comparison between the two with added highlights on the differences.

    Well done A.J., this little piece is definitely the way to “rant” about Cake and discuss the advantages/disadvantage of each framework. I hope your future posts are as equally neutral and to the point as this one. :)

  5. December 24th, 2008 at 06:16 | #5

    I’m curious though… how many noses do you have? :D

  6. bob
    December 24th, 2008 at 09:18 | #6

    Dont apologize too much. Cake’s documentation is poor as well. I went with CodeIgniter since it has full documentation and is pretty lightweight.

  7. December 24th, 2008 at 10:01 | #7

    Just to clarify some misconceptions about CakePHP and PHP4.

    1. There is nothing preventing you from making your application code strictly PHP5.

    2. If PHP5 features are available they are used in the core.

    3. A great deal of success/popularity of CakePHP can be attributed to the PHP4 support, since believe it or not, many hosts still only provide PHP4 (google for more info).

    4. CakePHP developers are sane :) They take great care in ensuring that full PHP5 compatibility is slated for future releases and that it is gradually and consistently introduced into the core.

  8. December 24th, 2008 at 11:52 | #8

    Wait a moment, are you saying that Zend Framework is not a framework. :-\

  9. December 24th, 2008 at 17:03 | #9

    Yeah, #1 is totally true and I didn’t mean to assert otherwise if I did. What I was bothered by is the fact that that style of code is still there. It’s really the difference between looking at a coat and seeing something that keeps your warm, or seeing something that will make you look good.

  10. December 24th, 2008 at 17:03 | #10

    Don’t get me wrong, I absolutely love Zend Framework, and I do use it as the framework for my applications. But, If you think about what “Framework” means, it’s not purely a framework. It can be a framework if you use the standard project layout, but you don’t get that out of the box. By that, I mean you don’t exract Zend Framework, and immediately start building your project on top of it. To be fair, it does exactly what it’s meant to do — be useful enough to use as a framework, but flexible enough to stay out of your way and provide support as a library.

    With Cake, you do exactly that. You extract everything into your project folder, and you start creating controllers right away, and your project’s structure comes out of the box. There is an open source framework out there that extends Zend Framework and gives you an application structure out of the box, but I can’t remember the name of it right now. If I find it, I’ll post a link.

  11. December 24th, 2008 at 18:03 | #11

    Actually, Zend does have a tool for starting a your projects (google zend_tool)

  12. December 24th, 2008 at 18:16 | #12

    @Jeremy
    I was wondering what Zend_Tool was for ;) Haven’t gotten to try that one out yet. Good call!

  13. December 24th, 2008 at 18:23 | #13

    A.J.
    I haven’t played with it much beyond seeing what it does. As I recall, it creates a project using zend’s recommended layout along with a basic bootstrap. It can also create apps withing the project, but they’re really very basic (ie just the basic setup - default action and view). It does still have a long way to go. I personally prefer the modular layout and have been working on my own script modeled after symfony’s setup.

  14. Chucho
    December 25th, 2008 at 04:56 | #14

    This is all nonsense mate, sorry. It looks to me that you have absolutely no idea of frameworks or experience using them. Do you speak Ruby or Python? Have you ever used Rails, Symfony or Django? Did you ever created a web service that uses LDAP authentication? Did you ever unit tested a web service?

    On your other post you mentioned things that doesn’t make any sense, and now in this one you keep writing random stuff that is wrong. Zend Framework is not an MVC framework? Oh dear. Have you ever used Zend_Controller? The you said that Zend is looking for the approval of RoR folks? What the hell dies that mean? What are you talking about?

    Like Bon Jovi said: “You give love (PHP), a bad name”

  15. December 25th, 2008 at 05:10 | #15

    @Chucho
    Firstly, the answer to all of your questions is yes, with the exception of Symfony :) Ironically enough, I’m writing an primer on unit testing controllers in Zend Framework right now.

    Secondly, you’re missing the point. It’s not that Zend Framework isn’t a framework, it’s that Zend Framework is about 10% framework, 90% library. It’s also not that that’s a bad thing. Calling Zend Framework a pure framework is like calling PEAR a framework. The only components that make up an MVC framework are Zend_Controller, Zend_View, Zend_Layout, and Zend_Db. I’m currently counting over 50 components in the latest stable release, on top of all of the components currently in incubation, on top of all of the proposed components (including two I’m currently working on proposals for).

    The statement that Zend Framework looks at Ruby on Rails for ideas and strategy comes from spending time in the development community. There are literally comments like “as we strive to be ruby on rails-ish”.(I’m looking through my inbox and nabble to find exact quotes right now.) It also comes from perception from people who have used and review it, as well as by just by looking at the way things are done.

  16. Chucho
    December 25th, 2008 at 11:05 | #16

    @A.J. Brown
    So, that means you’ve never used Zend_Form, Zend_Test, Zend_Filter, Zend_File, Zend_Validate, Zend_Http before? Those components are included in all of the frameworks, including Zend. From an architectural point of view, ZF is an MVC framework, which happens to offer more components than any other framework. Also, MVC has nothing to do with frameworks. There are plenty of frameworks out there that don’t follow the MVC pattern. Not to mention the ones used to build games, desktop applications and so on.

  17. December 25th, 2008 at 12:40 | #17

    @Chucho
    I think you are picking on him a little too much. He obviously does have experience and knowledge in ZF or he wouldn’t be advocating it so extensively as he does.

    Just because he doesn’t phrase himself well or get his point across clear enough sometimes does not mean he lacks knowledge, so give him some space, will ya?

  18. December 25th, 2008 at 22:34 | #18

    A.J: I respect your past experience with CakePHP, but I hope this post and the previous one teach you a lesson: you have to think before write, and support what you mean with examples and concrete words(in this case, code). Otherwise, you will make a fool of yourself when real experts comment with their knowledge and you respond writing regrets type posts.

    On the other way, if it was a marketing move, it has been brilliant. A lot of comments, a lot of visits, and the audience is waiting for more post of you. I´m not trying offend you, but maybe you need to start thinking about a career as web marketing guru and leave programming to others.

    Just my 2 cents.

  19. lqdice
    December 26th, 2008 at 06:52 | #19

    So far 90% of benchmarks I’ve seen (and ones I have done) comparing Cake vs Zend shows that Cake can handle more concurrent requests (just Google it). On top of that, Cake has only gotten speed optimizations in the past 2 RC releases and the code is not even stable yet.

    Please, don’t say Cake is heavy and use Zend as counter example. That’s just ridiculous.

  20. Chucho
    January 8th, 2009 at 08:19 | #20

    @Martin Bravio

    > I hope this post and the previous one teach you a lesson

    Teach him a lesson? Are you out of your mind? “8 Reasons to Hate CakePHP” is one of his best posts. Why is it so difficult to admit that Cake sucks? Come on, it’s just a bunch of legacy files glued together by some weird variation of the MVC pattern built on top of a deprecated version of the PHP language. Come on, time to let go and move forward. Why do you think the PEAR folks don’t say “Use PEAR, use PEAR”? For the same reason you should stop saying “Use Cake, use Cake”.

  1. December 23rd, 2008 at 13:31 | #1
  2. December 29th, 2008 at 21:24 | #2
  3. December 30th, 2008 at 23:20 | #3
Comments are closed.
Technorati Profile