I understand the maintainability of front-end code and the maintainability of code.

Source: Internet
Author: User

I understand the maintainability of front-end code and the maintainability of code.

After 20 days in the new company, I did two tasks, which were not complicated, but nested in the original system, I often did not know how to start.

There are two reasons.

First, the demand is unclear. There is no communication between products and programs before code writing. I use their prototype, but the prototype is too rough. After doing so for a while, I even found that it was not what I thought, resulting in useless work. Of course, this is not the main issue. After knowing the situation, I will definitely take action.

Second, what I want to talk about in this article is code maintainability.

The current Code is messy, especially the back-end ones. The front-end is much better, the directory structure is relatively clear, and common plug-ins and tools are encapsulated. However, page inconsistencies still occur. The root cause of the inconsistency lies in the lack of mutual reference and conventions during development, and the absence of a document. When faced with the vast amount of code, we do not need to go deep into the code, but have a global grasp of the Code. The functions and none of the current Code. In that case, the newcomers do not have to worry about re-implementation. In essence, team development is the process of writing lib together. What we need to do is try to improve this lib so that it can be used quickly next time. Boostrap is such a product. The construction of lib is also very exquisite. It is worth studying what each part does and what is reserved. If you have experience, write it specially.

The existing code is organized in seajs to modularize the code. Merge and compress using grunt. This greatly improves the reusability of the code and facilitates the construction of the Code.

I went to the D2 forum in Hangzhou last Saturday. The main topic of this forum is frontend and backend separation. I deeply understand the advantages of backend debugging. There is no need for the front end to spend a lot of time verifying the correctness of the data for the back end. The front-end can manage the front-end process and logic. You can use the imitation data to run the stream. The backend does not need to display results on the front end.

These will be our tasks for the next period of time. Pai_^


How can I improve the maintainability of software code?

Software documentation: complete requirement analysis, outline design, and detailed design
It is easy to maintain and improve documents in the future. I think this is the most important
Code compilation must comply with certain specifications
Comments must account for at least 20% of the code lines
It is recommended that each function contain no more than 100 rows.
And comments the input and output usage of the function.

What is the front-end code div + css?

Programming Language for creating web pages

Related Article

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.