3

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).

mvbl fst
  • 133

8 Answers8

18

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.

Demian Brecht
  • 17,585
11

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.

3

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.

3

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.

1

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.

0

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.

0

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.

Chris Holmes
  • 2,254
0

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.

GrandmasterB
  • 39,412