What is the advantage of using a PHP Framework?
I’ve been wondering what the advantage is of using a PHP Framework, rather than hand coding everything. I’ve tried to use some, but they never worked correctly for me.
Observing members:
0
Composing members:
0
5 Answers
The advantage is speed and support. With any framework, you are relying on the work of others to speed up your development process. Because so much has been built in, you don’t have to reinvent the wheel each time. You don’t have to rewrite everything.
Plus, you get the support of a community of users when you do encounter a problem. Anytime you find a problem or need, you strengthen the product for the next person or the next project.
The downside is that sometimes your particular need is such an edge case that it doesn’t make sense to add into the framework. In that case, you end up doing just as much work as if you didn’t have a framework.
It’s basically an open-source or community version of the type of code repositories that most companies keep. Most development outfits write something once and then reuse it across projects. It’s the same type of model.
MVC – model, view, control
You’ll see this a lot in frameworks. The best way to understand it is to use the analogy of CSS and HTML. You can change specif ways your code works by changing one part of MVC rather than all of it.
(CSS / HTML) make up the view portion of MVC.
MVC allowes for quicker scalability, and the possibility to reuse parts of MVC without adapting the other two to match.
Those are just some of the advantages. Be sure to use an MVC framework like Cake or RoR if you get at it.
@soundedfury True, I do have some reusable classes that I use frequently so I don’t have to rewrite each of those things each time I start a new project. But development still gets pretty slow when I have write a bunch of common simple methods.
@Breefield MVC Eh? Doing my reading now, thanks for pointing it out to me!
Thank You All For Answering!!
To add to the previous answers…
It also adds a lot of best practices. For example, I use the Zend Framework and it has an excellent MVC architecture that I’d never be able to work out by myself.
Then there’s the added benefit of security – frameworks are often rigorously tested so the quality is very high.
Plus, it saves you a lot of time on coding the common stuff so you can spend more time coding innovative, fun and new stuff.
Response moderated (Spam)
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.