To Use a PHP Framework or Not? [closed]
I've started writing a few applications in PHP, and I'm becoming more familiar with the language. Someone told me about CakePHP, and CodeIgniter. I wanted to get a better understanding of how these could help me, and whether it's worthwhile spending the time to learn a framework?
Solution 1:
What are the benefits of using MVC PHP frameworks ?
Well there are many benefits of using PHP frameworks, let’s see some of the main benefits of using them.
- These PHP frameworks follow some design pattern, so when you use a framework you have to follow their coding convention, which makes your code clean and extensible for future purposes.
- The Popular PHP frameworks like CakePHP, CodeIgniter, Zend Framework, Symfony follow Model View Controller (MVC) design pattern which separates business logic from user interface, also making the code cleaner and extensible.
- As everybody can guess, these frameworks contain a lot of libraries to make your job easier. For example: to validate a form you don't have to write as much code as you have to do in normal coding scenario (without using a framework), just a few lines of code calling the library is usually enough for it.
- While working on a large project in a team, an MVC PHP framework will be a great tool for development as you can assign a developer to develop one part of a module for a developer and integration will be quite easy of these developed modules at final level.
- These MVC frameworks really help you to develop the project rapidly, if you know a framework well then you'll never worry about the project deadline.
- Most of these MVC frameworks use clear url approach making your web project SEO friendly.
check article
Solution 2:
My philosophy is that you should only use something when it solves a need that you currently have.
There's a real tendency, particularly in this realm, to simply use a framework for the sake of using one or because you feel like you should be using something. I discourage such practices. Also frameworks I think have the most value when you've done things the hard way so you have a good understanding of what problems you have and how the framework can help you in that situation. Framework choice does depend on the situation.
That all being said, the MVC pattern with Web applications is useful so it certainly wouldn't hurt you to learn at least one. I'd stick to a fairly minimalist framework however. CodeIgniter springs to mind here.
Lastly, the other danger with frameworks is that they can be so invasive that you're no longer doing PHP, you're doing CakePHP, Symfony or whatever. That's not necessarily a problem but the danger in it being so invasive is you don't get a good grounding in PHP and if you ever want to change it'll simply be too hard that you'll never be able to do it.
Solution 3:
One of the great perks of PHP frameworks are that they minimize reinventing the wheel in a great number of common web application needs. Security issues, graceful exception handling, RESTful URLs, and reusability of code across your site are fairly universal considerations.
It may be easier to familiarize yourself with the tools of a framework and then see if you want to take on the full MVC system it supports. For that end, I'd suggest familiarizing yourself with the Zend Framework. ZF works as a library of classes which can be implemented individually for particular uses--anything from security to Lucene search--but contains classes which, when used together, implement a fully fleshed out MVC paradigm.
Solution 4:
i just want to tell about my own experience in programming, I'm still newbie though
- first by using framework you'll get used to their coding style/rule, which is good because most of the framework are deeply thought about how they write their code. in short i get better style and cleaner code
- Usually framework come with many arsenal (plugins and or library), which you can find in internet, this will reduce your coding time, cut wasted time. In short you can make your own precious time thinking on business process
- with using open source framework, there's other programmer who already know and probably mastered the framework, then you can easily collaborate with others.
- in truth i'm not a well organized programmer, but it was before i 'm using some open source framework. perhaps like me you'll get more organized
That's all I can share with you for now, i'm not good with writing in english, sorry for that. but the point is i recommend you to use framework
Happy coding friend.