Php frameworks are tools that it’s common to find in a developer’s studio.
Artists make use of tools to forge their artistic creations. Php developers are artists creating php software and php frameworks are some of their tools.
Does a php developer need php frameworks in the same way as a painter needs pigments?
Not exactly. You can create software without frameworks. If you create clean and well-designed software, you can do without frameworks.
While there is no need to explain why a painter needs pigments, there is a need to explain why developers use frameworks.
A team of php developers is like an artist collective. A group of artists working together to create an artwork.
Artistic creations have some characteristics that are common to every form of art.
We want to enjoy an artistic creation as long as possible. Even if it isn’t a masterpiece, it’s always a proof of human creativity.
This is why we need documentation. Even for the restoration of a painting documentation would be great. Imagine if Van Gogh had left detailed documentation about his painting techniques, the pigments he used and the materials.
It would be much easier to restore his paintings so that future generations can enjoy them. Unfortunately, that documentation has to be recreated by the hard work of investigation.
Software is artwork that isn’t static. It’s a collection of instructions by which a computer transforms information to serve a purpose.
Its durability is more difficult to protect.
Software isn’t prone to wear and tear like a painting, but it has to be easy to change and maintain because changes in hardware or other software can easily make it stop working or become no longer useful.
It can also happen that software has to change if it is to continue to serve its purpose.
Certainly software that no longer works or that works but is no longer useful should stay in museums like any other human artwork.
But software is made to work and we enjoy it more if it works and is useful.
This is why documentation is so important when creating software.
There is no durability for software without documentation.
Many artworks need the collaboration of many artists to be created.
Php software is no exception. Large php applications are created by teams of developers. There is a need for organization and collaboration if a large php application has to be built successfully.
Can’t we write just a single long php script? Yes, we can. But how will many developers collaborate? Will they edit the script at the same time? It won’t work. We need to divide the software into many files and have each file assigned to a different developer. Two developers can’t work on the same file.
Structure also means that we need to know precisely what each file is for. This helps developers with their creative efforts. Every part of the software can be created successfully if the role of each of them is well-defined.
It’s like an orchestra. Every musician has to know what the other musicians are going to play in order for the orchestra to give life to a symphony.
Every art has its tricks of the trade. It’s true that creativity longs for novelty, but why reinvent the wheel? Before experimenting with new sounds when creating music it may be a good idea to have a look at existing ones.
In the same way, before creating new software to perform a task it’s good to see if this has already been done.
To use existing code to perform a task reduces errors and helps other developers deal with your code if they are familiar with the code you used for that task.
Php frameworks help developers to:
Let’s have a look to a few of them.
CodeIgniter is light and fast. It’s easy to configure and learn. It has a rich set of ready-to-use functions that save you time.
It’s flexible. You aren’t forced into strict rules. This may be seen as a minus point, but CodeIgniter is mainly used for small-medium applications so lack of structure is less of a problem.
It has a large community that helps.
CodeIgniter is the base for a CMS (Content Management System) called ExpressionEngine. It’s software similar to the well-known WordPress.
This is why it’s particularly suitable for creating CMSs.
CakePHP will look familiar to developers who used Ruby on Rails. It’s a php framework simple enough for beginners but powerful as well.
It uses quite strict conventions that help to improve clarity and make development easier. On the other hand, these strict conventions may not suit your needs for flexibility.
CakePHP is good for rapid prototyping and comes with a lot of features to help with implementing common tasks.
Laravel is the php framework for web artisans. I like this. I agree, software development is craftsmanship.
What strikes one about Laravel is its elegance. I wouldn’t recommend this php framework to a beginner, but it’s perfect if you want to go to the next level. In particular Laravel is great if you come from CodeIgniter.
Laravel is more complex and powerful than CodeIgniter. It features code originating from more complex php frameworks and made easier.
YiiFramework is a newcomer. It focuses on performance. It requires a lot of command line work that makes it less suitable for beginners.
It’s known for being the best choice if you want to develop social applications.
Don’t expect complexity and esoteric features. YiiFramework is newer than other php frameworks, so expect a less developed community.
FuelPHP is another newcomer. You can learn HMVC by using it. HMVC is an evolution of MVC and it isn’t for beginners.
FuelPHP makes use of command line utilities like YiiFramework. Its functionalities are rich but don’t expect the complexity of bigger php frameworks.
As with any other newcomer in the php frameworks arena, its community needs time to grow.
DooPHP fits into the light-and-fast category. It is easy to learn and use, but it is best suited for intermediate developers because it can lack documentation and community support.
Kohana follows the HMVC pattern. As I have already pointed out this is not for beginners.
Add to this insufficient documentation and you know that you are better off building your muscles with some easier php framework.
Kohana too is in the light-and-fast category, but this doesn’t mean that it isn’t powerful.
Let’s pass to the elephants of the category. And I mean it literally since Zend’s logo is an elephant.
You use Zend only for huge applications that justify the complexity of Zend.
To use Zend for a small-medium application is like using a sledgehammer to crack a nut.
Just have a look at their website and you will find a rich gallery of big names.
Anticipate devoting a long time to learning it.
Zend has been created by the creators of PHP itself, so it can be a good place to learn PHP.
Symfony is an old php framework and it’s one of the big guys together with Zend.
Like Zend, Symfony is used for big applications that have to fit enterprise requirements.
It’s not for beginners, but it has a large community so help is readily available. There is also a rich collection of tutorials on their website.
It comprises a fully-featured PHP debugger, dynamic help, advanced auto-complete and FTP/SFTP client.
I know that a few years in a corporation can kill the artist in the most creative of developers. They would make Van Gogh paint using a printing press.
However, there are alternatives. In any case, php frameworks are one of the most important tools to consider when setting up your workshop.