I'm curious, what are the advantages (and disadvantages) on using a framework with PHP?
I've been using PHP on and off since version 3. I've never used any of the frameworks available for PHP, so what am I missing out on?
I'm curious, what are the advantages (and disadvantages) on using a framework with PHP?
I've been using PHP on and off since version 3. I've never used any of the frameworks available for PHP, so what am I missing out on?
Framework abstracts you from low level details, makes you more productive, and protects you from low level error ( such as preventing SQL injection attacks).
A good PHP framework forces you to separate your concern and implements the proven architecture, which in the end improves your design, and makes your code much easier to read and maintain and unit test.
Here are some references on why you should use framework
A good framework guides you through best practices for your architecture and gives you somee often needed functionality in a proven and stable way. So you don't have to reinvent the wheel all the time.
Do not reinvent the wheel
That's what is all about. A framework have all the main functionality implemented using the best practices acknowledged through years of experience.
Speed of development for one. It also removes a lot of burdens that come with coding stuff manually (and yes it means don't reinvent the wheel).
(I am a Symfony developer and so I will answer in a way revolving around Symfony. There are other frameworks that have similar functionality, however, in my opinion none are quite as comprehensive or well written as Symfony).
Quoted from the Symfony Web site:
A framework streamlines application development by automating many of the patterns employed for a given purpose. A framework also adds structure to the code, prompting the developer to write better, more readable, and more maintainable code. Ultimately, a framework makes programming easier, since it packages complex operations into simple statements.
Symfony is a complete framework designed to optimize the development of web applications by way of several key features. For starters, it separates a web application's business rules, server logic, and presentation views. It contains numerous tools and classes aimed at shortening the development time of a complex web application. Additionally, it automates common tasks so that the developer can focus entirely on the specifics of an application. The end result of these advantages means there is no need to reinvent the wheel every time a new web application is built!
Symfony is written entirely in PHP 5. It has been thoroughly tested in various real-world projects, and is actually in use for high-demand e-business websites. It is compatible with most of the available databases engines, including MySQL, PostgreSQL, Oracle, and Microsoft SQL Server. It runs on *nix and Windows platforms. Let's begin with a closer look at its features.
Most of the common features of web projects are automated within symfony, as follows: