The Usefulness of using PHP Frameworks

The discussion about PHP Frameworks and their usefulness is old and its origin untraceable. Every programming language has at least one, and 99% of the time, more than one. So this creates 2 very important questions:

1) What IS a framework?

Definition A: a framework is a structure. It’s a set of rules that allows us to organize the codes and files we create.

Definition B: today the word framework is also used to refer to a predefined and closed package. It’s created by a company (Symfony, Cake, Laravel, Yii). The list for PHP is as extensive as problematic. That is not only a filesystem structure but also a group of tools, libraries, and shortcuts.

Know Intraway’s work on implementing frameworks by reading: Intraway’s Scrum Implementation Story

2) Do we need to use them?

If we’re talking about definition A, the answer is a plain YES. Even if you’re a one-man team, or you are not the one who thinks of the rules governing your code, you need organization. Your sources in a folder, endpoint/assets in another, views, models if you’re using MVC, etc. If you’re throwing code around without order, you’ll soon find yourself in a kind of development hell.

With the definition B, things get interesting. Big and established frameworks try to reach to every common use case that we come across in a development lifecycle. This means that unless you’re planning to use a full suite of tools (view building, database connection, etc.), you might not need everything. In fact, the less you need, the more inclined you are to think the entire thing is just a cumbersome stockpile of tools.

You might be missing the bigger picture. Are you planning to improve your application? Is there a roadmap, or a simple idea to add a feature or two? 99% of the time, you will be looking to improve your work and that’s when a framework shines. Instead of using your time to create these tools, you use the already developed features. Suddenly, a feature that used to take you ten hours can be completed in two. But also with the added advantage that the tools you used are more developed, documented, and maintained than yours. As your app grows, you will use more tools from the framework. That means your time is better spent making your code clean and useful. You need to spend less time creating tools to do the work, and more time doing the actual work.

The Situation of PHP Frameworks

The lesson here is that frameworks exist and are popular for a reason. With PHP in particular, there’s an overcrowding problem. In this situation, a lot of frameworks are trying to set their own standards, and specialization becomes a problem.

The optimal is to discard the all-too-familiar idea of “I can do this better” and don’t try to reinvent the wheel (unless that’s your end goal). Use every tool available to simplify your work, and look for the framework that adjusts the best to the situation. Last but not least, never code so deeply that you cannot decouple the framework from the logic.

Further reading on frameworks for applications by clicking on PHP Development Environment: Fast and Simple