When I first started working at Code Greene, I was building my PHP applications and sites the “old fashioned” way, with nothing more than a collection of common functions and a single MySQL class that I carried around with me everywhere. I have grown very accustomed to my small collection of code, and have begun to rely on it a bit (and actually almost failed the entrance test to Code Greene because I couldn’t find it). But I always built my applications from scratch, every time.
As I progressed in my PHP career (and hobbies), I noticed that I was building the same things over and over again, but only slightly different every time. This was an issue that I had noticed but never really put some serious thought into… until I started at Code Greene. My first day there, I was told to take a look at CakePHP and learn it, because it was to be the defacto PHP framework for the office. I took a quick glance at the code base and was instantly overwhelmed. There is so much stuff going on behind the scenes in Cake that it boggles the mind a bit. I went through a few online tutorials, and still felt that I knew nothing about it, let alone how to use it, but I could tell that it would either make or break my new job.
My first Cake project with CG was not an easy one–it was huge. It was the largest project I had worked on to date, and to top it off, I was forced to code it in Cake, which is almost a whole new language in itself. As I worked on the project, I felt very frustrated at times, and wanted to just slip outside of the Cake bubble and code things the way I knew how, with some straight PHP. But I didn’t, and I’m glad. I’m sure I made a ton of rookie mistakes. There is an extremely steep learning curve, but I was progressing with my Cake experience, and it’s well worth it once you get the hang of it.
As I work on projects now, I can pretty much get the whole back-end of the site, and all the inner workings and relationships between the data in the database and everything the administrator needs to CRUD that data set up in less than a day, even for fairly large projects. All the magic in the background is provided by Cake. All I have to do is give it some details and let it do it’s thing. It truly is cake. Today, I can turn a small project around in a day or two, when it used to take me a week just to get the relationships and administration stuff built, not including the front end portion of the site.
I’m by no means a Cake expert, but I have cut my build times down to less than half, and in some cases you can count the percentage decrease on two hands. I am also no longer overwhelmed by requests for gigantic monolithic sites, and requests to change things that would normally make me cringe. I look at some of the sites that we build at the office, and I wonder how we could ever possibly build these sites in the time that we do if we didn’t use Cake. It’s a win-win situation for both the office and our clients. We don’t have to sweat the little things, and the client gets a fully-functional site in much less time.
My opinion of Cake may be a bit biased, as I have no basis for comparison. Other frameworks may be better suited for some of our smaller sites that we build, but I have no doubt that for our larger sites, Cake is the right choice. In the future, I would also love to try some other frameworks, if only to compare them with Cake, but I’m pretty sure that CakePHP will always be my framework of choice.
What’s your framework of choice? Leave a comment below.





I’m just now really starting to get my feet wet in Cake. Or would it be moist in Cake? Gross.
Anyway, even from a front end perspective, I can see how having a framework to help standardize some coding conventions is beneficial. We’ve been working hard on the front end to build our own front end framework that will integrate with Cake, including a javascript library, CSS resets, and some other default settings.
Now if only we could find a way to plug SASS into Cake…
I’d be interested to know what other people think who have used both Cake and a similar framework for PHP, or even Ruby on Rails. How do they stack up in your perspective?
I used to be exactly the same way. I always made everything from scratch and it took more time than I care to remember. Now I use Zend Framework for anything that I need to create.
I don’t favor the Zend Framework over any other framework, it just happens to be the one I started using. I’ve wanted to try CakePHP for awhile now.
Anyways, I know exactly what you went through.
Quite a love story that i myself am experiencing!
I love the structure that Cake allows you to work with.
I was developing/learning with Django a few months ago, totally lost. Come back to PHP and am happy to say CakePHP is the framework that has made sense from the get go.
Thanks for sharing!
Codeignitor FTW
Ha but yeah. I love Codeignitor, but one of these days I’ll get around to trying other frameworks.
I have looked at several frameworks including Cake, Ruby on Rails, Symfony (ug) and found them all a bit complex for the sites that I am building right now. I have settled on Smarty, I know, I know, kinda simple but coming from the “code it all by hand” world it was easy to use and learn.
I have worked with CakePHP a lot but right now I work with Ruby on Rails, I can tell you that it is better in so many ways than Cake and it might seem difficult to learn because the fear of a new language but it’s worth doing (Ruby easier than PHP). Right now Iam learning Django and it is really amazing.
I had the same experience my first time with CakePHP–I wanted to just go back to coding straight PHP. But now I’m beginning to love it. They could definitely do with some more organized, easier-to-read documentation, though.
I haven’t tried CakePHP very thoroughly yet, but I’ll be sure to give it a spin sometime soon. I’m a CodeIgniter user myself.
To whomever’s still not using a proper framework: your days are numbered. There is no escape. You will be assimilated.
I’m not currently using anything as I haven’t the need yet, but its coming very soon, and I’m not sure what framework or even language to use. I’m pretty comfortable with php, i’ve been using it since September last. I’ve been snooping around several frameworks in different languages like Zend, CodeIgnitor, CakePHP, Symphony, Rails, Django, etc..
I’m pretty much left with Rails and CakePHP and Code Ignitor.
CI looks easiest to learn and the documentation is pretty easy for me to understand, Cake seems very detailed but not very novice friendly. I have a few friends that are Rails Developers and they are willing to help me to rails, I’m just worried about how sustainable it is due to the huge PHP saturation in the market, and there’s not much Rails demand because regular people don’t know about it, and theres a slim picking for hosting with it. I know its getting better, and the server I am going with for my business is going to be Slicehost.
I don’t know. I’m still trying to get into the programmers mindset. It’s all very diluted right now. Nice article though.. mind pointing me to said ‘good tutorials’ as, I’ve searched, and not found one that has introduced the cake concepts to me clearly yet. Thank you.
The tutorial I cut my teeth on, was the IBM tutorial, which is now quite old, but gave a basic walk through of building a site. Although it uses things like scaffolding which are not recommended for a production site, although very fun to play with.
And another tutorial that I found.
Great to have another baker! Be careful with the “magical” CRUD powers of CakePHP though. The model’s recursive level is a tricky thing and I do still turn debug level to 2 as I feel safer going through the generated SQL statements.
On the point of not using CakePHP on smaller websites, why not? :p
I have aggregated The Code Code’s CakePHP feed on http://planetcakephp.org/aggregator/sources/1240-the-code-dojo if you don’t mind.
I’ve been developing for the last 9 years. Since I got into frameworks, I can’t imagine myself one day “digging holes without a shovel”.
Everyone says it’s hard to learn how to use frameworks. The fact is that almost everyone of them don’t know OOP. If they knew, it wouldn’t be hard at all. All you’ve got to do is understand MVC structure and the core functions. Right?
I started in CI, stayed for long enough to know it well. Then took a look at RoR. Man, RoR is really exciting. Then, I came to CakePHP and decided to stay on it, because it is the most complete PHP framework out there. I will wait some more time for the Ruby on Rails to grow up, then go and use it.
CodeIgniter is good, have a lot a core functions, is fast, but you will have to code some code, anyway.
Zend is more of a structure of development than an automatic framework. Its learning curve is really terrible.
Ruby on Rails is not mature enough, I think. One quote that I considere true (cause I’ve been on RoR and saw it), is that if you are on RoR that’s because you’re classy and cares about writing beautiful code.
CakePHP is amazing, all automatic. Its Bake is the developers’ paradise. I made an application up and running in 2 MINUTES!! I also love its ORM system. The only drawback is that it takes 300ms to load even on small systems.
Alexandre de Oliveira, I think you’ve got a wrong Idea about Rails, it is mature enough to do any stuff. I’ve worked with CakePHP with big asn small sites form more 2 years, it is great but not comparable to Rails, I’ve been programing with Rails for 8 months now and I can tell you that I can do sites better in less time and with testing.
I agree Boris. After I commented, I saw a misunderstanding in my text. What I mean by immature is related to the business environment today. A few hosts offer support to it. Some clients are willing to still pay for a PHP4-5 hosts, which are cheaper. Most of the time, if you have a robust application, if you make use of a dedicated server using Ruby, it usually will need more hardware (since you’ll need more memory). Here in Brazil, only one well known and trusty hosting server is supporting Ruby. I know it’s that way in a lot of countries out there. I think in a year or 2 it won’t be so anymore.
I think Rails is really exciting. Its core has got mature because of its great community. I have myself made my plans already, I will leave PHP and go to Rails as soon as I can.
I’m so glad I’m not the only one.
About a year ago I started playing with CakePHP, and it was a nightmare. I could make some things work, but it was hard to be motivated and really “do” things when I didn’t know how things were being done. I played with CodeIgniter and the docs were so simple, it made sense. It cut down on work, maybe not as much as CakePHP, but to a point where it wasn’t overwhelming.
Now I’m trying CakePHP again, and I have that same feeling. The first day was basically me in awe, going “Wow, this is amazing. This is so cool.” The second day, I’m thinking “Okay, but how does it work?” And now, the third day I’m kind of tired of figuring out all the conventions and when to use what function, etc.
I do want to stay motivated though because I know it’s a great framework.
It took me about 3month of learning PHP and developing my own framework from scratch to figure it out that I will need maybe 2 or 3 year to complete my project.
Then, I need about one more month to decide to start from all the php frameworks with CakePHP.
After all the learning of the PHP OOP and framework concepts, I need about 3 days to learn Cake at basic level.
And all I used the most was not the standard manual (good enough even at that time) but..google.
2 months later I was already developing components for Cake and my project time has been reduced 3 times or more.
Indeed, who say that CakePHP is hard to understand doesn’t know much about OOP & MVC concepts.
Of course, is hard to rember from start all the conventions who make less coding, but with cheatsheet or notes is much easier.
The only disavantage of the Cake at this time is that seem one of the slowest PHP framework (with exception of Zend maybe)
Maybe this will change with 2.0 version.
It’s nice to see evolution. I disagree now about what I thought was right 2 years ago.