Frameworks Make Programmers More Productive
Currently, on the Southeastern Michigan PHP User Group mailing list, there is a discussion of PHP frameworks. I’ve always known that I should be using them, but while they do offer a number of benefits, they can have a steep learning curve. I kept putting it off, saying, “I’ll use on on the next project.”
As a result of this discussion, however, I’ve decided to bite the bullet and start using frameworks. The one I chose was CodeIgniter. According to one message, “It’s lightweight, robust, and has very good documentation.”
Some of the others mentioned include:
There are even more on PHP Frameworks.
To test CodeIgniter, I developed a small application to collect and display the fortunes from fortune cookies. This was a rewrite of an app that I wrote several years ago without a framework.
Even with having to learn the framework, this took me only about four or five hours from start to finish. While I don’t recall how long it took me to do the first time, my guess is that it probably took about the same amount of time. So, if you subtract the amount of time it took to learn about CodeIgniter, then the development time was shorter using the framework.
Using the framework also enabled me to think differently about the application. Using the framework, you have to think in terms of model, view, and controller (MVC). This kind of thinking allows you to segregate these functions instead of lumping them all into one big page. For example, when developing a view, you only have to worry about how to display the data, not how to generate it. That’s the job of the controller.
I’m sure that there are some “gotchas” that I haven’t encountered in this simple application, but overall I think using frameworks is the way to go. You can be I’ll be using CodeIgniter for my next development project if it’s appropriate.