Take the 2-minute tour ×

Title is the question. And why I am asking is because from what I read about most PHP frameworks (e.g. Code Igniter, Kohana, Cake, Zend) is that they're ether too complex, or are designed mostly for small applications (like blogs).

share|improve this question
Don't believe everything you read. –  Byron Whitlock Jan 7 '11 at 22:11
@Byron - isn't your comment a bit self defeating? –  Cfreak Jan 7 '11 at 22:13
@SODA - The main problem I have with the various PHP frameworks is they are often designed with specific use-cases in mind. That doesn't mean you can't use one, you just have to research carefully to make sure that whatever you choose supports all your features you want to use, or at least has a clear way to add your own custom plugin. I think of the off the shelf stuff Symfony is great. A little complex but it has excellent documentation. I've also rolled my own. I think it depends entirely on the situation. –  Cfreak Jan 7 '11 at 22:17
Does anyone else think that this question sounds like, "Complex frameworks are too big for small applications, and small frameworks are too simple for complex applications"? –  erjiang Jan 7 '11 at 22:18
@cfreak, only if Byron had said "anything". –  user1249 Jan 8 '11 at 18:30
show 5 more comments

migrated from stackoverflow.com Jan 8 '11 at 18:26

This question came from our site for professional and enthusiast programmers.

8 Answers

up vote 17 down vote accepted

I'd always use an off-the-shelf framework. There is almost never a good reason to build your own from the ground up. You'll spend a lot more time with the plumbing work and bug fixing writing your own than relying on tested and optimized methods already existing in the OS packages. Most of the frameworks have built in methods to extend them if needed and if they don't, I hear PHP frameworks are pretty easy to go in and modify as needed ;)

My suggestion is to evaluate a few of them and pick which one suits your needs. I've tried Yii, Kohana and CodeIgniter and found CodeIgniter to have the smallest learning curve and yet still supplies (almost) all of the functionality I needed for my application. For functionality not included out of the box in CI, they expose hooks for customization.

share|improve this answer
@Demian: I strongly disagree. Off-the-shelf frameworks aim at being generic, often including a lot more than you actually need for a specific application. This can become tedious when debugging and optimizing. Why use 10 classes when all you need is one? –  netcoder Jan 7 '11 at 22:43
@netcoder: Sure, off-the-shelf frameworks aim at being generic. Coming from a C/C++ background, would I re-write the STL because it's generic and I think my implementation would be more optimal? No. Why? Because the library has been written, tested and optimized by people with far more experience in developing libraries than I have. Same holds true here. The benefit of the off-the-shelf frameworks is that both they're tested and optimized for you already and that they can boost productivity a TON once you've wrapped your head around them. –  Demian Brecht Jan 7 '11 at 22:51
@netcoder: Granted, the example may not have been the best (framework vs. library), but the gist of it remains true. Frameworks are tested and optimized and are proven to boost productivity. And at the end of the day, whether it's commercial or personal, who doesn't want to be more productive at the expense of a few interpreter cycles? –  Demian Brecht Jan 7 '11 at 23:01
@Demian: Sure frameworks are optimized, but for what? They're optimized for genericness. Optimized for you and aim at being generic just don't go together: one is specific, one is generic. –  netcoder Jan 7 '11 at 23:03
I've spent more time debugging and overriding Zend than it saved me from using it in the first place. As for the troll-o-meter, well not at all, this is an argumentative question and it doesn't belong on SO anyway, which is probably why it has a couple close votes already. –  netcoder Jan 7 '11 at 23:32
show 7 more comments

I've written virtually all of my sites from scratch. In my case, the reason is primarily because I enjoy creating things and that's also a great way to learn. It's much less fun for me to spend time trying to learn someone else's code than creating my own.

But that's just a personal reason. If you find a nice off-the-shelf package that does exactly what you need, then I could certainly understand using it.

share|improve this answer
Wait till you see the productivity enhancements you get when you learn a good framework. You also are ignoring that learning to do it your way isn't always the best way. There are some sound well thought out patterns and ideas in the major frameworks. But it is definitely more fun to reinvent the wheel. :) –  Byron Whitlock Jan 7 '11 at 22:26
Building site frameworks from scratch is not synonymous with not learning. In fact, I would strongly suggest the opposite is true. While developing a site, I do a lot of research and ask a lot of questions to learn how other people might have done it. How is learning someone else's interface and ignoring how their code works a better learning experience? –  Jonathan Wood Jan 7 '11 at 22:44
Most of the time, I don't care to write another login module. I know how to do it, i've done it a million times, I don't want to do it again. Also Zend, codeignighter etc have had many contributors. The codebase is the sum knowledge of many coders. And if you haven't taken a serious look at how others have done it, you will certainly miss out. Not all frameworks are equal, Cake is all auto-magical garbage that I personally hate. Zend is more like a OOP extension of the php standard functions. –  Byron Whitlock Jan 7 '11 at 22:51
In todays time its usually inadequate to build everything yourself. you dont have the time and/or the manpower. especially since everything changes so quickly. after a few months/years, the database access, the underlaying php, xml, json, ... might have totally changed. you cannot adapt everything on your own all the time. a framework does that for you. you can stay focused on your main task: DEVELOPING. –  mark Jan 7 '11 at 23:15
Right, you can't develop everything yourself. So instead of using assembly language anymore, I use tools like C#, .NET, ASP.NET, etc. But that doesn't mean I can't still write software. And learning about algorithms and, for example, the most efficient way to store and retrieve tags in a database is what I enjoy. If someone prefers using higher level components, I can respect that. But if someone is adamant that only Microsoft and a few select developers should work on algorithm-type stuff, then I think you're way out of whack. –  Jonathan Wood Jan 7 '11 at 23:30
show 2 more comments

If your primary motivation is to get something done (as opposed to learning), my general advice is that I would first go with whatever you already know and are comfortable with that can handle the job well. If a task exceeds your capabilities at the moment you then look for a package that extend your capabilities to handle it.

share|improve this answer
Well there is a saying that "It's not best to swap horses while crossing the river" - meaning that if you have a working app that needs to be scaled, it's probably too late to start re-coding it using another approach, another framework etc. –  SODA Jan 7 '11 at 22:37
Look at most successful websites: Facebook, Twitter, etc. What percent of those used an off-the-shelf solution? –  Jonathan Wood Jan 7 '11 at 23:38
My argument was not in support of off-the-shelf frameworks, but to say that swapping platform in the middle is a bad idea. –  SODA Jan 7 '11 at 23:45
@Jonathan Wood - what both Facebook and Twitter did was start with something technically simple (though innovative) and build from that. They didn't sit in a corner and program and conjure up success. And I am pretty damn sure that both facebook and twitter have looked into other existing solutions and used many that they have found would increase their pace and stability. –  pellepim Jan 7 '11 at 23:53
@pellepim: So you agree that these most successful sites wrote them from scratch. Good. –  Jonathan Wood Jan 8 '11 at 0:00
show 3 more comments

I am about 90% done with a craigslist-type application. I have built it from scratch using straight PHP, and things have came along quite well. We are now finalizing things and adding some advanced features that you do not see in any classified websites.

share|improve this answer
Sounds cool. That's what I like to hear from programmers: programming! :-) –  Jonathan Wood Jan 7 '11 at 23:30
add comment

Programming frameworks are useful when you're working closely with a group of developers, have tight deadlines, need to implement web api's like twitter and facebook, and are developing large systems with 10+ DB tables.

If you're coding alone, on small personal projects, or sites which aren't time critical, and basically exist in a vacuum, then doing it by hand without a framework is fine, and IS faster.

I've made fully custom CMS within two weeks without a framework. On the flip side, when I code with other developers, having systems such as CVS / SVN / Git, and following the conventions of a framework are invaluable. My solo coding eccentricities don't confuse the other developers, just as their solo coding eccentricities don't confuse me, when we're all using a framework. Plus, I don't have to rewrite an entire Twitter OAuth class and Twitter API class, which would take a week or more by hand.

share|improve this answer
add comment

I would use Codeigniter. It's the least like a framework in comparison to Zend, Kohana, Yii, Cake, Symfony and any other known PHP framework. It has a small footprint, it is dead easy to learn and really powerful. The only downside is no out-of-the-box ACL, but there are many great pre-written libraries out there to add that in.

I've been using it for quite a while now and have written both small and very large applications on it. And when I say large I mean almost enterprise type of large. Due to NDA's I cannot say exactly what, but trust me, Codeigniter has no limit in terms of what can be done with it.

share|improve this answer
add comment

I would always choose to write it myself.

Learning alone is enough of a reason (and why I would disagree Demian Brecht's answer). In our career field, knowledge is king. The more you have, the more valuable you are as a problem solver.

But the other thing is: I just always have the belief that I can do it better. Maybe that's ego talking, but I just believe it.

share|improve this answer
add comment

It really depends on the context of the application.

If this was simply a classified ad system for a local community group or church, I'd use a canned system.

If this was the core application for a business, I'd write it from the ground up. This way the code base is 100% known and understood, and it'd be designed specifically for the task at hand. It wouldnt be completely 'from scratch', I guess, as I'd re-use/adopt a lot of classes from other projects, and I'm sure there'd be 3rd party pieces used for various features (mailing, image generation, etc). But the basic frame of the application would be designed specifically for the application by the company, and not rely on a third party framework.

share|improve this answer
add comment

Your Answer


