Home > Article > Backend Development > Is it better to use native PHP or a framework?
Unless you write a simple small program, a few hundred lines of it, just write it natively.
Slightly more complex projects generally use frameworks, which are faster to write and make less mistakes. (Recommended learning: PHP video tutorial)
php framework is mostly used in China thinkphp, even if it is to support domestic products, you should learn it~~
There are many internationally popular ones like Laravel, CI, YII, ZF, etc.
Companies generally use frameworks for projects, and even develop their own frameworks themselves.
The development of software systems has become very complicated today, especially server-side software, which involves too much knowledge, content, and problems.
Using other people's mature frameworks in some aspects is equivalent to asking others to help you complete some basic work. You only need to concentrate on completing the business logic design of the system
. Moreover, the framework is generally mature and robust, and it can handle many detailed issues of the system, such as transaction processing, security, data flow control and other issues. In addition, frameworks are generally used by many people, so the structure is very good, so the scalability is also very good, and it is constantly upgraded, and you can directly enjoy the benefits of other people's code upgrades.
The biggest benefit of the framework is reuse. The biggest reuse method obtained by object-oriented systems is the framework. A large application system may often be composed of multiple layers of frameworks that cooperate with each other.
Because the framework can reuse code, it becomes very easy to build applications from an existing component library, because the components all use interfaces uniformly defined by the framework, making communication between components simple.
Frameworks can reuse designs. It provides reusable abstract algorithms and high-level designs, can decompose large systems into smaller components, and can describe the internal interfaces between components.
These standard interfaces make it possible to build various systems through assembly based on existing components. As long as it conforms to the interface definition, new components can be inserted into the framework, and component designers can reuse the design of the framework.
The framework can also reuse analysis. If all personnel analyze matters according to the idea of the framework, they can divide it into the same components and adopt similar solutions, so that analysts using the same framework can communicate with each other.
The above is the detailed content of Is it better to use native PHP or a framework?. For more information, please follow other related articles on the PHP Chinese website!