Hi Chris welcome to the forums.
This question is a biggy, so I’ll try and break my response down a little.
Why use frameworks?
At the end of the day it pretty much comes down to deadlines. The company I work for usually allots a certain amount of time to a project which the client has signed off on, so the more time I save developing an application, the more money the company makes; and the better I look. :D
There are a couple of ancillary reasons also:
- It allows me to break certain parts of an application up so that: I don’t repeat myself as much.
- More than one developer can be working on a project at one time.
- I can quickly implement functionality through the use of “libraries” (provided by the framework).
Frameworks, like CI, also help tremendously with maintainability. Because the code is broken up into pieces (objects). Making changes generally means I only have to touch one part of the code, whereas otherwise I could have to edit multiple files.
The last thing, which is super important, is that most frameworks try to take away the headaches that you often get from different versions of the language/platform. For instance, CI does a pretty good job of working on BOTH PHP 4 and 5. Likewise most JavaScript frameworks will work around many cross-browser issues.
Why not push into a CMS like drupal?
Well, something like CodeIgniter is probably not the best fit as a Publishing platform (CMS). CodeIgniter (as I understand it) is more targeted at online applications (think Gmail, Twitter, Flickr, etc… An application framework generally has a lot of the necessary code in place to make the building of these applications as quick and simple as possible, whereas a CMS is geared towards Content. In short, it would be harder for me to “bend” drupal to make it do what I need it to if I am building an application.
<subtitle>I have never used drupal - so I am just speculating, but I have extended other CMS’s before and it’s not nearly as easy as using an application framework.</subtitle>
What experiences do you have working in groups on a project, is a framework an advantage?
Yes, I work for a company with multiple developers and we recently launched our first production application built on CodeIgniter. Because CI uses the MVC paradigm different people could work on different parts of the application without too much overlap/conflict. For instance, we had one developer building Models and DB Schema’s while another worked on application logic and validation, while a designer put the styling touches on top. Of course, we had version control so if we did overlap it didn’t really matter, but the point is that we all lose less hair (now) thanks to the framework. 😛
Frameworks don’t necessarily solve issues with documentation, codewriting rules etc… That’s still something that you have to agree on as a team. Most PHP developers (should) use the phpDocumentor format as the CI core does, but the framework doesn’t enforce that per se.
Something like Ruby on Rails is probably a better example for that sort of thing, because there are more solid conventions built into the framework and most of the code ends up reading back like plain-english; so (actual) documentation is rarely needed.
Why did we choose CI?
We looked at a lot of different frameworks, but what we really wanted was something that we didn’t have to learn. Frameworks like CakePHP and Symfony have a lot of very strict conventions and take a bit to learn and we weren’t so keen on that. They are also quite resource heavy and in the benchmarks we did CI kicked everything off the map. So, it’s light, it’s simple, it’s very extensible (extendable) and it wasn’t still in beta.
There are two other things that are very important to me personally (because of my role here at work): Wherever possible CI doesn’t reinvent the wheel; it just tries to use regular PHP (such as in the templates) and also it is licensed right. We had previously been using a framework that is licensed under GNU/GPL which prevents us from being able to commercialise our hard work, whereas CI has a very developer/business friendly license giving us a lot more freedom to make up our own minds about what we do with our code.