当前位置:网站首页>How to restrict the unity of code
How to restrict the unity of code
2022-04-22 02:28:00 【Second rate small yard farmer】
Hello, Everybody, iron , Today, let's talk about how to restrict the unity of code .
When you start a project with more and more collaborators , There will always be a problem , That is the unity of the code , It is said that , One thousand thousand , Put it in the code , A hundred schools of thought contend , After all, everyone has his own thoughts , It also has its own style of writing code , How to make a project , Move towards a unified style , This is very difficult , The difficulty is not the formulation of norms , But the implementation of norms .
Why unify ? When it comes to this , You must be iron , Is the one who has the most say , Although not unified , It can also make the project run normally , Normal Online , But the problems that come with it will continue to be exposed , such as , Code redundancy , Redundancy to a project may have N Network requests ,N A tool class with the same function ,N A method with the same code, etc , Another example is code specification , Existence in multiple naming ways , It could be an underline , It could also be a hump , As well as the problems of multiple technology selection , Do you use A technology , another use B technology , And so on , Resulting in the increasing volume of the project , It's becoming more and more difficult for subsequent successors to start , In the long term , The stability of the project will be greatly discounted .
Unity of code , At the beginning of the project , We should have our own technology architecture and technology selection , There must be a leader involved , We can discuss and implement the plan together in the early stage , such as , Technology selection , Code specification and so on , After all the preliminary formulation , Form document , This is very important , Not just for today's developers , It is better for others to take over in the future , Form an effective reference . Unity of code , Although it restricts the developers' expansion thinking to a certain extent , But in the stability of the project , Sustainable development , Has a certain role , After all, as developers, we , Whether the project is stable or not , Directly related to their own survival or not , Iron men , This is by no means alarmist , think about it , A project that crashes at any time , What do you think your situation will be ?
Constrain the unity of code , No matter the project from scratch , Or a project already under development , It is necessary to implement , Briefly list the following points .
One 、 The unity of Architecture , Unification of technology selection , Unification of all basic libraries
framework , Technology selection , Base library , Basically formed the cornerstone of a project , At the beginning of development , There should be enough time to organize and develop , It is said that , Sharpening a knife never misses a woodcutter , The premise of these foundations , It is necessary to carefully sort out . One project, one architecture , This must be the premise , if , There are multiple architectures , Then the maintenance cost of this project will increase several times , Subsequent access is also time-consuming and labor-intensive . Unification of technology selection , Like network requests , data storage , Image loading, etc , A project can maintain a pattern , A variety of ways , It is bound to cause redundancy in the code , The increase of access cost of follow-up personnel . Unification of basic library , For example, tools commonly used in projects ,Dialog,Banner wait , Carry out unified extraction , Unified use , Avoid the existence of multiple situations , It is basically consistent with the technical selection .
After all are unified , There must be a document , framework , Use of various technical points , Basic library call and so on , Try to be comprehensive , After all, in most cases, this is not developed by one person , It's collaborative development by multiple people , And there will be people involved in the follow-up , Relative to this architecture , Technology selection , Basic library, etc , There must be someone who doesn't understand , Where it's not clear , If you have a comprehensive document , Then it's faster to get familiar with it , And can quickly enter the development state , Greatly improve the development efficiency .
The following figure shows me based on the existing architecture last year , Technology selection , Basic library, etc , A document written .

Two 、 The formulation of norms
With the infrastructure , Technology selection , After the basic library , Also formed a certain document , Then enter the development , Norms must be taken seriously , For example, the code specification ,git Branch management and submission specifications , Third party dependent specifications, etc , Be sure to implement firmly , Nothing can be accomplished without norms or standards , Only standard landing , In order to ensure the unity of the project , Code neatness , The stability and robustness of the project .
alike , Based on the above , There must also be documentation output , Oral preaching is difficult to achieve memory , Only the basis of the document , To constantly deepen the impression , Documentation should also try to , Meticulous and comprehensive , Cover a wide range , In the making of norms , There must be something missing , It can be continuously improved in later maintenance .
3、 ... and 、review Implementation of the mechanism
I said it at the beginning , Specification making is particularly easy , But it is very difficult to implement , After all, there are a lot of collaborative developers , Everyone has his own thoughts , Development process , There will inevitably be many different voices , Various complex code scenarios , therefore , A set of review Mechanism , In each submission or in days , Look at your actual situation , To continuously target the code review, Find a place , Correct one place , That's the only way , In order to keep the code unified in the long run , Run according to the established rules .
review This is very necessary , Under the existing specifications , You'll never find out how others operate , Just a quick example , Such as below , It was before me review A problem found , These questions are really incredible , Iron men , Can you detect any problems ?

At the end of the day , How to restrict the unity of code , In a word , Focus on execution and inspection .
版权声明
本文为[Second rate small yard farmer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211443123629.html
边栏推荐
- Advanced Android interview answer, full analysis of gradle source code
- MySQL8. 0 zero foundation beginner level: from bronze to diamond
- Scala installation and environment configuration
- Go use options mode to set parameters
- Swift 泛型的使用
- Page 58 Siemens digital solutions for machine tool industry
- Review of SV knowledge points
- 使用navicat将mangodb的数据做转储
- Interview question: use the program to realize the alternating printing of odd and even numbers from 0 to 100 by two threads
- error:there‘s no Qt version assigned to project please assign a Qt installation in qt project settin
猜你喜欢

In PostgreSQL, convert a string to an integer or floating-point type in the query result

Evaluation of arithmetic four mixed operation expression

WSOLA principle and MATLAB simulation

What are the pitfalls of risk control product quota?

The shortcut key for modifying the drawing board size of illustrator (AI) is shift + O by default

Plug in import and usage of uni list

Leetcode-232 - queue implementation with stack

uni-list的插件导入及使用方法

Explain various cloud computing models in detail. How can enterprises use each model to improve business productivity?

softmax运算
随机推荐
golang 1.8泛型测试
illustrator(AI)的画板大小尺寸修改快捷键默认是Shift+O
微软新工具准确率达80%?程序员:我谢谢您
Uniapp realizes the effect of birth date / time selection
unapp封装一个加载动画
uniapp处理强制刷新问题
68 smart pipe gallery project construction solution
软件测试·坏味道
Another way to write the fluent interface is to write a part first, then material, and put the method body in the method body
Mysql的索引为什么使用B+树而不使用跳表?
Page 49 information planning and digital transformation of petroleum and petrochemical industry
flutter 界面的另一种写法,先写一部分再用Material,在方法体里面放方法体
Introduction to Alibaba's super large-scale Flink cluster operation and maintenance system
How to select the appropriate neo4j Version (2022)
Pychar executes multiple script files at the same time
使用navicat将mangodb的数据做转储
Analysis of header NAT & DHCP protocol
JMeter + Jenkins + ant persistence
In PostgreSQL, convert a string to an integer or floating-point type in the query result
Unity game optimization - third edition reading notes Chapter 1 analyze performance problems