Why are the advantages and disadvantages of using frameworks?

Source: Internet
Author: User

Start of Text

We have a framework for efficiency and ease of use. The framework can save development time. The framework enforces the use of common conventions, so it can effectively solve some common problems, such as page rendering, assert judgment, security, or application configuration. These common problems have a common feature that will be used in every web application.

The framework is very good and can make decisions more coherent. The framework can avoid writing a lot of custom modules to achieve these performance. All we need to do is to put these shared modules in the framework for implementation. The framework saves us a lot of time and effort and makes expansion easier. But this is also the root of the problem.

Since the framework can provide a lot of help when we make code decisions, we become lazy. We do not consider how to use abstract thinking to build a clean and clear system, or whether the final code is clean and clear, but rely on the framework to implement these requirements for us.

For hammers, everything is a nail

Abraham Kaplan said that he would better complain about the disadvantages of the tool: Give a hammer to a child and he will use it to all the things

When we use this principle on the framework, we are the victim of the tool. When we encounter a requirement that is not very consistent with the framework, we will be lazy. We will solve our problems according to the established methods of the framework. Because it is the easiest to use the established framework method to solve the problem, we have neglected how to design the best code for future expansion and other requirements.

This is the time to determine if you are more professional. Instead of delivering the code that is best for future extension. It is to better design your code for future needs or to let people in the future consider the demand, this is the responsibility of programmers. As a more professional developer, we must think independently of the framework.

This is your error.

Do you often hear someone complaining about a framework? I have heard many people complain about Rails: "Rails Applications are always in bad structure" or "Rails testing is always so slow ". At first, I thought so. But now, whenever I hear these complaints, I will realize that the resentment is actually lazy. Rails, or other frameworks, is just a tool. You have to control it. Blaming the bad code for a life-free framework only shows that you are not professional.

Select the right tool or use the tool correctly

Using framework development is also writing code. As a developer, you have the right to choose how to implement your needs. People want to develop clean and tidy code, so it is very important to use object-oriented thinking and reasonable abstraction. To develop good code, we must carefully consider our code design, especially when using the framework.

Decided to become more professional

We must select Tools Based on basic requirements. The framework does do a lot of work, and the requirement determines the entire code structure. Sometimes the framework is suitable for a certain requirement. But when the framework is not suitable for some needs, you have the responsibility to modify or encapsulate the framework for code clarity and cleanliness.

Author

Myles Megyesi

Text ended

Post reading
The framework is just a tool mentioned in the article. You cannot use this tool to meet all your needs. When the framework cannot meet your needs clearly and completely, what you need to do is not to write a lot of junk and troublesome code to meet your needs, nor to modify your needs to meet the need for easier implementation. As a more professional user, you need to modify the framework or use abstract thinking to make your code clear and clean.

This is often encountered in actual development. When someone asks you: why is the code written here? If your answer is: No way, because the framework does this, I can only do this. This indicates that you have been bound by the framework. Do not think that the framework is authoritative or written by others. It does not take your requirements into account when writing it. As long as your requirements are public requirements of the team and need to be modified, you should modify the framework when adding a framework.

Selecting and using a framework is the basis of the control framework. After you select a framework, you must be familiar with the Framework. When the framework cannot meet the requirements, do not hesitate to abandon or modify the framework.

Code is easier to read and develop. If the code is bound by a framework, it is actually the last mile.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.