CakePHP 2.0 Rant CakePHP 2.0 Rant

I was recently visiting the CakePHP bakery and decided to read a little bit about CakePHP 2.0-dev.  I've rather enjoyed CakePHP as a framework since version 1.1 all the way through to version 1.3.  However, after reading some of the "features" for version 2, I have to say, I'm a little disappointed about their focus.

In the bakery, there are 6 core features listed that they deem worth mentioning.  The two that stand out to me the most are:

- Lazy loading model associations - Associated models are loaded on-demand greatly improving the memory use and performance of larger applications.

- Lazy loading of Helpers and Components - Helpers and components are loaded/constructed as needed helping performance.

Lazy loading, like most people, you are probably thinking, "oh wow, what a great way to improve speed!".  Well, no offense, if you're thinking this way, you are the one that's lazy!  Sorry for the shot.  But if you really think about it, if your application is developed correctly in the first place you shouldn't rely on the framework implementing features like lazy loading, your application should be setup in a way that it is only retrieving the data that it needs and most importantly, when it needs it.

I can see it now, all of our models relationships will have recursive set to 2 because CakePHP will only fetch the data when I need it.  This will make development so much easier!  Well, yes, I agree that development times might speed up, but unfortunately, speed of development isn't the only thing we can care about.  At some point, hours and hours of time needs to be dedicate solely to ensuring OUR (not the framework's code) is as optimized as it can be.  If we don't, no matter how optimized CakePHP tries to be, your code will never be.

Ok, I'm done ranting, I just don't like it when developers are taking the lazy way out!

Published on Jan 31, 2011

Tags: CakePHP Tutorial | lazy loading

Related Posts

Did you enjoy this article? If you did here are some more articles that I thought you will enjoy as they are very similar to the article that you just finished reading.


Learn how to code in HTML, CSS, JavaScript, Python, Ruby, PHP, Java, C#, SQL, and more.

No matter the programming language you're looking to learn, I've hopefully compiled an incredible set of tutorials for you to learn; whether you are beginner or an expert, there is something for everyone to learn. Each topic I go in-depth and provide many examples throughout. I can't wait for you to dig in and improve your skillset with any of the tutorials below.