Although many people are against the use of frameworks, they are good as they provide a solid foundation developers can use to develop websites. Some rely on front-end frameworks such as Foundation and Bootstrap while others use frameworks like Rails and Yii for developing web applications.
There are also a number of frameworks we can use with WordPress, generally consisting of two types – drag and drop frameworks and option frameworks.
Drag and drop frameworks allow a user to quickly build a website’s user interface. These frameworks often consist of a number of pages accessible through the WP dashboard. They allow pre-defined elements to be arranged on a page in a certain way for the user to see.
In contrast, option frameworks are quite different, are normally used for specific functionality and are closely connected to the WordPress APIs, among these the Meta Data API, the Settings API and some templates related APIs.
However, both types of frameworks exhibit certain advantages and disadvantages, and these are all important when considering whether you should work with a framework or not.
The most obvious advantage to using frameworks is rapid development, which allows to assemble functionality at a much greater speed thus increasing the efficiency of your work.
Some people regard this as rapid prototyping but WordPress frameworks have developed so much that, when working with the API, you can create not only interfaces but also applications and sites.
The level of abstraction is yet another advantage to using a WP framework. They tuck away the repetitive code that we otherwise have to write. One such example is the Settings API, which is very cumbersome when we use it to get elements to show on screen. The use of frameworks solves this problem by presenting us with a way to generate options and settings with a much clearer code and fewer calls to functions.
Frameworks also offer the means to melt the difference between what is expected to happen and what happens in reality. The perfect example for this are the drag and drop frameworks. They present you with a number of regions to work with like header and footer areas, content areas and sidebars. They also have a number of containers in which you can place those regions. The end result looks identical on both the front and the back end.
You can do the same with API-specific frameworks. Writing code doesn’t have the visual nature of the drag and drop frameworks but API-specific frameworks come packed with clear function names and classes, as well as other facilities that help understand the way in which all software pieces come together.
Let us say you want to create a setting in the dashboard of WordPress and generate a textarea supporting plain text and nothing else. This means you will have to label it, validate, sanitize and display the data. If you use a framework for the task, instead of doing it the way it is described in the WordPress codex, it can be done with a single call to a function.
When you are using a framework, you are creating dependency between WordPress and a third-party code. If your code is dependant of a framework, which in turn is dependent on WordPress, then what you can do with the framework is limited to the latest WordPress version the framework supports.
Choosing a framework which is often updated to be compatible with the latest version of WordPress is important. This allows you to update your project and sync it with the most recent WordPress version.
However, if the framework is lagging behind the latest WordPress version, your code will only be as secure and updated as the version of WordPress it supports.
Then there is the issue of deprecation. Frameworks often use deprecated functions no longer used by WordPress. This requires from you to wait for the next release of your framework that hopefully would deprecate its code.
If your framework is using deprecated function calls, it may not be a big issue for a release or two but once the WP core completely removes the functionality and it hasn’t been addressed by the framework you are using, your code with be incompatible with the latest WordPress version.
Although frameworks are very powerful, when you use them, it is often best to write all your code on the framework instead of using it only for a certain features and writing the rest of your code not based on a framework.
If you are using an incomplete framework that lacks certain functionality, you are usually left with two options – either discard the feature you want to include in your project until the framework makes it available to use or use core WordPress code alongside it.
There are many advantages and disadvantages to using WordPress frameworks and although this article is far from listing them all, it mentions the most usual considerations a developer faces with WordPress frameworks.
There are going to be tradeoffs whenever you decide to use a framework, and the nature of your project will dictate whether it is best to rely on a framework in your particular case