Home >Backend Development >PHP Tutorial >If I am new to writing PHP for my graduation project, is it better to write it natively or use a framework?

If I am new to writing PHP for my graduation project, is it better to write it natively or use a framework?

WBOY
WBOYOriginal
2016-10-24 00:12:392578browse

I want to use PHP to write the background of my graduation project. The functions are not very complicated. Visually, I just need to process some forms, operate several tables in the database, and write an interface. Is it better to write natively, or to learn a framework and use it? I know a little bit about native, but I have never used the framework.

Reply content:

I want to use PHP to write the background of my graduation project. The functions are not very complicated. Visually, I just need to process some forms, operate several tables in the database, and write an interface. Is it better to write natively, or to learn a framework and use it? I know a little bit about native, but I have never used the framework.

I suggest you stay native, know more about the bottom layer of PHP, and know how to debug bugs if they occur. Because when you don’t have much development experience, even if you use a framework, you can only use some of the ORM and class libraries that come with the framework. Instead, the framework’s features and design patterns (such as drivers, dependency injection, events, containers, middleware ) and the like will confuse you even more.

And if you haven’t read the source code of the framework, there may be some inexplicable errors that you don’t know how to deal with.

The features of the framework itself, design patterns, etc. are not used at all. If you don’t understand it, you may use it incorrectly. If you show these codes to your HR in the future, you may be deducted points.

The framework is good, because for the graduation project, the paper or design book is the big one, the function is the main thing, and the tools are the secondary one. Of course, it comes as quickly as possible.

Native +1.
The framework actually wraps some very commonly used functions for you to call directly, such as database connection and back-end rendering.
The framework is generally suitable for rapid development. There is no need to worry about repeatedly assembling mysql query fields and how to render html. These are things that a developer should know how to do. If there is an error in the code, there will be a lot of non-native debug information, which will be difficult to understand if you are inexperienced.

Of course, although it is recommended to use native and not use templates, it is recommended to use templates when rendering HTML. Pure templates, such as smarty, separate the front and back ends.

laravel 5 would be a good choice.

Rich information and quite popular at the moment.

1. If you just want to use the framework to complete the functions you mentioned (pages, databases, etc.), there are complete routines for your reference. All you need to do is follow suit.

2. If you want to accumulate something for finding a job after graduation, search for relevant technologies used in the framework, learn some theoretical knowledge, and then see how it is implemented in the framework, which will benefit you a lot.

3. The so-called native PHP is not bad, but as a novice, of course, the most efficient learning method is to first learn, imitate and think from excellent frameworks.

4. Finally, basic knowledge is of course very, very important. I believe that you already have basic PHP programming knowledge and a general understanding of web technology. The rest is to practice.

You can use a framework, you don’t need to pursue anything fancy, just realize the functions. As for the choice of framework, tp5 is fine. It has Chinese documentation, which is a big advantage. As for the design pattern and the internal principles of the architecture, just ignore it, as long as you know how to use it.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn