Why use the framework to use the advantages and disadvantages of the framework _ related skills

Source: Internet
Author: User
Body Start

We are creating a framework because of efficiency and ease of use considerations. The framework can save development time. The framework enforces the use of public conventions, so it can effectively solve common problems such as page rendering, assert judgment, security, or application configuration. One common feature of these shared problems is that they are used on every Web application.

The framework is very good, it can make the decision more coherent. The framework avoids the ability to write a bunch of custom modules to implement these capabilities, and all we need to do is put these common modules into the framework. The framework saves us a lot of time and effort and makes it easier to expand. But this is also the root of the problem.

Because 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, not to consider the final code is clean and clear, but rely on the framework to achieve these requirements for us.

all things are nails to a hammer.

Abraham Kaplan said a word that best accuses the disadvantage of a tool: to give a child a hammer, everything he encounters with a hammer mallet.

When this is used in the framework, we are the victims of the tools. When we meet the demand is not very consistent with the framework, we will be lazy. We will solve our problems in accordance with the established method of the framework. Because it's the simplest way to use a framework-defined approach, we've overlooked how to design the best code for future extensions.

This is the time to measure whether you are more professional and deliver the best code for future expansion rather than delivering the easiest code to implement. For the future needs of better design your code or let the future people do the needs of the time to reconsider, this is the responsibility of the programmer. As a more professional developer, we must not rely on the framework to think independently.

this is your fault.

Do you often hear someone complaining about a frame? I've heard a lot of people complaining about rails: "The Rails app is always a bad structure" or "the rails test is always so slow." At first, I used to think so. But now, whenever I hear these complaints, I realize that the complaining person is lazy. Rails, or other frameworks, are just a tool, and what you have to do is control it. Blaming a lifeless framework for bad code can only mean that you are unprofessional.

Choose 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 you want to achieve your needs. People want to develop clean, neat code, so it's important to use object-oriented thinking and rational abstraction. To develop good code, we must carefully consider our code design, especially when using the framework.

decided to become more professional

We have to select tools based on basic requirements. The framework does a lot of things, and the requirements determine the entire code structure. Sometimes the framework will fit a requirement. But when the framework does not fit certain requirements, it is your responsibility to modify the framework or encapsulation framework for the clarity and cleanliness of the code.

author

Myles Megyesi

Body End

Reading
The article mentions that the framework is just a tool, you can't use this tool to meet all your needs, and when the framework doesn't clearly and completely meet your needs, you don't have to write a bunch of garbage code to fulfill your needs, not to modify your needs to meet the need for easier implementation. As a more professional you, you need to modify the framework, or use the abstract and other thinking to make your code clear and clean.

This is a lot to be experienced in actual development. When someone asks you: Why does the code here write? If your answer is: no way, because the framework is doing so, I can only do so. This means that you have been bound by the framework. Do not think that the framework is authoritative, the framework is also written by others, it will not be written to take into account your needs. As long as your needs are the public needs of the team and need to be modified and added to the framework, you should revise the framework.

The selection framework and the use framework are the basis of the control framework. What needs, what size to use the framework, choose a good framework after the use of familiar framework. When the framework does not meet the needs, do not hesitate to discard or modify the framework.

Code is a more clear and natural reading and development, if tied to a framework, is actually putting the cart before the horse.

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.