当前位置:网站首页>About the professional ethics of programmers, let's talk about it from the way of craftsmanship and neatness
About the professional ethics of programmers, let's talk about it from the way of craftsmanship and neatness
2022-07-06 22:00:00 【Alibaba Amoy technology team official website blog】
《 The way of craftsmanship and neatness 》 It's uncle Bob's neat new book series . This book mainly focuses on discipline 、 standard 、 Three aspects of ethics describe how software practitioners should demand themselves , Improve R & D quality 、 efficiency 、 Moral standards , This article focuses on 《 The way of craftsmanship and neatness 》 Part three -- integrity , Talk about how our programmers should self-discipline 、 Self improvement .
Why programmers need professional integrity ?
▐ The strength of the industry Big
This problem also has to start with the development of the software industry . The software industry was born (1935) so far (2022), It has a history of more than 80 years .
in the meantime , The whole software industry has made great progress :
The number of employees has exceeded 100 million
Computer / The number of electronic devices exceeds that of human beings
Software monitors and coordinates the operation of the whole society
Public awareness of computers and software , From the early years, it was mainly machine , Up to now, the programmers behind the machine are the main . In the early 《 Star Trek 》、《 Space Odyssey 》 Wait for the machine / Computers play an important role . With the advent of personal computers ,《 The matrix 》、《 War games 》 Wait for the movie to gradually take programmers as saviors , Programmers are lifting the veil of mystery , Be understood and accepted by society .
--->
▐ The influence area expands
As a programmer , Although we are not the makers of various rules , But we wrote code to run these rules , And in the machine that comprehensively monitors and coordinates our lives . let me put it another way : Programmers rule the world .
The software we write , Record the schedule 、 Transportation of goods 、 Trade in goods , Controlling the steering wheel of the car 、 Rocket satellite , It can even affect the promulgation or enforcement of laws .
The tragedy caused by software errors , There are cases in all walks of life :
scientific research : Ground software error , Wrong unit used , As a result, the Mars Climate probe fell too deep in the Martian atmosphere , Torn to pieces .
Medical care :Therac-25 Accident of radiotherapy machine . Due to process conflict ,Therac-25 Use high-energy electron beams to cause 3 Human life lost , Also burned another 3 people .
business : Because of the wrong identifier , Dead code left in the system is activated , As a result, Knight capital group is 45 Lost... In minutes 4.6 Billion dollars .
traffic : Toyota's stack overflow vulnerability , It may cause the car to accelerate out of control , It may eventually lead to up to 89 People have been killed .
When something happens , Someone will be responsible for this , Programmers will be asked to clarify how to prevent this error from happening again .
therefore , We as programmers , There is an urgent need for clear professional ethics to self-discipline , In order to make the software industry have greater development , Also for our own better career development .
reflection :
Have you ever had trouble , What is the worst impact ? Whether it has affected the society ?
What is professional ethics ?
▐ Definition of professional ethics
WIKI The definition of professional ethics in is It refers to the lowest moral bottom line and industry norms that people must abide by when engaging in professional activities .
In professional activities , There are some recognized professional ethics , Such as :
The values of honesty
Make work reports honestly
Don't divulge secrets to your competitors
meanwhile , Each industry also has its own breakdown of professional ethics , Such as :
Doctor : Heal the wounded and rescue the dying , I love my job
The magician : Don't disclose the secret of magic
The public security police : Pay attention to investigation and Research , Handle cases without making assumptions , Subjective assumption
Legal workers : Be loyal to the Constitution and the law , Stick to facts
Teachers' : be a model for others , Caring for students
...
stay 《 The way of craftsmanship and neatness 》 in , Uncle Bob Put forward 10 The professional ethics of software developers .
▐ Professional ethics of software developers
The following is an excerpt from 《 The way of craftsmanship and neatness 》 :
To defend and maintain the honor of the computer programmer profession , I promise , To the best of my ability and judgment :
I don't write harmful code .
The code I produce will always be my best work . I don't intentionally let code that has behavioral or structural defects accumulate .
I will provide a quick at each release 、 Definitive and repeatable evidence , Prove that every element of the code works .
I will often make small releases , Do not hinder the progress of others .
I will fearlessly 、 Mercilessly use every opportunity to improve my creation . I will never let it change .
I will try my best to improve the productivity of myself and others . I won't do anything to reduce productivity .
I will always make sure that others can fill my place , I can also fill seats for others .
I will give an estimate that is reliable in order of magnitude and accuracy . I will not make an uncertain promise .
If my fellow programmers have enough integrity 、 standard 、 Discipline and skills , Can win my respect . No other attribute or feature will be a factor in my respect for my fellow programmers .
I will never stop learning and improving my skills .
Professional ethics of programmers ?
Uncle Bob proposed this 10 The oath can be divided into three types : damage 、 Integrate 、 The team cooperation , Let's talk about these three types respectively .
▐ About injury
I don't write harmful code .
The code I produce will always be my best work . I don't intentionally let code that has behavioral or structural defects accumulate .
I will provide a quick at each release 、 Definitive and repeatable evidence , Prove that every element of the code works .
What is injury
The software we write has an impact on this society all the time . Any unintentional behavior of us , May bring unexpected harm to this society .
for example People found that programmers at Volkswagen wrote some code , Deliberately obstruct EPA Emission test , Affect the assessment of environmental hazards by relevant departments , It has damaged the health of all people driving these cars .
If we let ourselves , You will treat yourself , Or people around you , Even cause harm to the whole society , Include :
Harm to society
Harm to your colleagues
Harm to future programmers
Function to / Damage caused by structure
Face the injury
The harm caused by the above Volkswagen programmers , Who is responsible for this ?
We as programmers , You might say that :" I'm just doing my job , This is not something I can control ."
however , If you know it will bring bad consequences but continue to do so , Then you need to bear part of the responsibility for the consequences . Please don't forget , One of the important reasons for the company to hire you as a software development engineer , You should be able to identify when the software may go wrong , You need to find it before it gets into trouble , And have the responsibility to say it out loud .
Avoid harm , Do my best
reflection : The following two systems , Which system is more valuable ?
The job is perfect , But it can't be modified
Can't do anything right , But it is easy to modify
The above two systems , It embodies the two values of software :
Behavioral value : Let the program work correctly
Structural value : Make the program easy to adjust
If a software system cannot be changed , Even if it works correctly , Finally, I can't get rid of the fate of being eliminated :
If a software system wants to provide long-term value , It must be able to respond to changes in demand . therefore , Except for the most urgent situation ( in personam 、 Company 、 A situation that causes disaster to society ), We should give priority to the second system . Even if we need a little time and money , But after that , It will continue to work forever .
Stick to the structure , It is related to our interests
In order to enable software to provide long-term value , No, current colleagues 、 Future colleagues cause harm , It requires that the software we write should have a good structure , The value of a good structure is :
Easy to test
Easy to modify
Easy to reuse
Write a good structure , It often takes us more time . We often encounter such scenes :
An urgent need comes , We are required to complete and go online within the specified time , But these times are often only enough for us to complete our needs , At the same time, your boss also requires you to complete this urgent need as soon as possible . If it's you , How to deal with this situation ?
The first thing to remember is : A project / Software success , For our career 、 Reputation has a direct impact , It is closely related to our interests . therefore , As a stakeholder , We have a say in the development and structure of the system ; meanwhile , We are also engineers , The company hires us , Because we know how to build software systems , How to build the structure of these systems , And enable it to provide long-term value , We need to ensure that the system will not be damaged by bad behavior and bad structure .
Look back to this problem , Does our boss know the structure ? Or is the boss's understanding limited to behavior ? If the boss clearly tells you to ignore the structure , Full attention should be paid to behavior , What should we do ?
We have to refuse , Because we are engineers , It's the stakeholders . There may be a fight 、 against , But our profession does not allow us to retreat . Maybe you think you'll be fired if you refuse , But most of the time not . Because most managers also expect to fight for what they need and believe , And they respect those who are willing to do the same thing ( Otherwise, there will be so many technology salons 、 Technology sharing and exchange meeting ?).
▐ About Integration
I will often make small releases , Do not hinder the progress of others .
I will fearlessly 、 Mercilessly use every opportunity to improve my creation . I will never let it change .
I will try my best to improve the productivity of myself and others . I won't do anything to reduce productivity .
Why should we focus on integration
Concurrency in software refers to : Multiple users may read and write the same data at the same time .
Software integration , There is also concurrency . As our projects continue to become complex 、 huge , When more developers participate in this project , Everyone is changing their functional modules at the same time , The problem of software integration conflict will become more and more prominent , It will eventually become a bottleneck .
The long ( Integrate ) Cycles hinder the progress of the team . therefore , We need to focus on integration , Pay attention to its cycle . It's about iteration , It works with editors / compile / The test cycle is related . Only by improving the efficiency of these steps , We won't hinder others' progress 、 Team progress .
Continuous integration
After so many years of development in the software industry , There are already many solutions . among , Continuous integration is a good means .
Continuous integration can bring the following benefits :
Find mistakes quickly
Prevent branches from diverging from the trunk
Continuous integration does not allow us to eliminate Bug, But it can make them very easy to find and correct ; It allows our software to iterate quickly at the same time , Still able to maintain high quality , Don't hinder others' progress .
Random acts of goodwill
Uncle Bob is 《 Clean code 》 The boy scout regulations mentioned in : Code is cleaner when checked in than when checked out .
If every time the code is checked in , The code is cleaner than when it is checked out , Then the code will not be corrupted . We can check the code every time , Conduct random acts of goodwill to achieve . Any act of goodwill , No matter how small , Will not be wasted .
We can increase the coverage of the test ( But it should not become a management indicator ), To help us improve our code , Help us write more robust code .
Another effective random act of goodwill is simple cleanup -- Refactoring for improvement . We can start with some simple means , Such as :
Optimize the naming of fields , Make code more readable
Clean up useless code , Reduce the cost of understanding
Adjust the code structure , Keep the code flexible
▐ About The team cooperation
I will always make sure that others can fill my place , I can also fill seats for others .
I will give an estimate that is reliable in order of magnitude and accuracy . I will not make an uncertain promise .
If my fellow programmers have enough integrity 、 standard 、 Discipline and skills , Can win my respect . No other attribute or feature will be a factor in my respect for my fellow programmers .
I will never stop learning and improving my skills .
The above points are mainly about the oath related to teamwork , To sum up, the main points are as follows :
Team spirit , Can be filled , Avoid team paralysis due to knowledge gap
Estimate honestly and reasonably , It's not easy to promise
Only respect professional skills 、 Discipline 、 Standards and ethics , Do not discriminate against each other for other reasons
Never stop learning , Keeping up with changes in the industry is respect for the profession , Is also responsible for their own career
Estimate honestly and reasonably , It's not easy to promise
How long does it take to tie a pair of shoelaces ? Maybe you can say it quickly :20 About seconds . Because tying shoes is done almost every day , You can be quite fast 、 Give a reasonable estimate accurately .
If you want to write a tutorial on tying shoes , How long will it take? ? Are you unable to make an estimate quickly and accurately ? You need to consider the audience of this tutorial 、 Whether you need pictures and texts 、 Space limit ……
This is the problem we often encounter as programmers : Estimated hours of work . The users we face may be novices , They may know nothing about software , We have to write software that is simple enough to use , And have enough detailed instructions ……
When a manager comes to you and says :“ I need this before Tuesday .” You are trapped by this problem , Because you don't know whether you can finish it by Tuesday . Maybe you have done something similar , It takes twoorthree days to finish ; Maybe there is a technical difficulty that is different from what you have done before , You don't know whether you can finish it on time .
So when you are asked to estimate something , You can't give a specific time , Because that's a lie , You don't know whether you can finish it at a specific time , You need to consider the best and the worst . If you do give a precise time , It's better to finish it by gritting your teeth . Because you are making a promise , So you'd better finish it on time , Don't have any excuses .
Give a reasonable estimate , You can do that :
Don't give a specific time easily , Be honest
The estimation of the project cannot be just a delivery date , It's a time frame
Disassemble the work items , Find out the hidden fuzzy factors ( Uncertainties )
Communicate with the manager , Spend more time refining blur factors , Such recursive operation back and forth
For the best case 、 The worst 、 In general , Estimate the probability of its possible occurrence , For this 3 Estimated date range for each case
Never stop learning
Our industry has been in the past few decades , Experienced rapid changes , And this change continues , We have to keep up with . This means that we must continue to learn , Keep reading books 、 Blog 、 Participate in technical exchange meetings, etc . Our employer has no responsibility to train us , We need to be responsible for our own business . Learning is one's own business , We need to figure out what to learn , How much time do you spend learning . therefore , In addition to working hours , Put in every week 10~20 Hours to cultivate and maintain our career , This is to maintain our professionalism .
At the end
“The simplest way to describe craftsmanship is pride of workmanship. It is the mindset that you are working on something important and you are going to do it well."
Programmer is a highly skilled profession , But it must also be bound by non-technical concepts ( Standards and ethics ). Only through the constraints of these standards and ethics , Will make our industry better and better . It binds our behavior , Put forward higher requirements for us , While enhancing our competitiveness , It will also bring us more sense of achievement .
Let's try our best together , Make a 『 Conscience 』 The programmer !
Reference Content
《 The way of craftsmanship and neatness 》 author :Robert C·Martin
team introduction
Welcome to Taobao mobile technology center , Team members Daniel gathered , There are the founders of Alibaba mobile middleware 、 Core members of eagle eye full link tracking platform 、 There is also a group of people who love technology , Small partners who expect to use technology to promote business .
Taobao mobile technology center , Promote Amoy system ( TaoBao 、 Tmall, etc ) Architecture upgrade , Committed to Amoy 、 The whole group provides basic core competence 、 Products and solutions :
Business highly available solutions and core competencies ( Applications are highly available : Provide adaptive current limiting for business 、 Flexible high availability solution for isolation and fusing , The site is highly available : Fault self healing 、 Multi machine room and remote disaster recovery and fast cut-off recovery );
A new generation of business R & D model FaaS( One stop function development Gaia platform );
Next generation network protocol QUIC Implementation and landing ;
Mobile middleware (API gateway MTop、 Domain name scheduling AMDC、 news / push 、 Upload files AUS、 Mobile configuration push Orange wait ).
We look forward to participating in the construction of Amoy basic platform ~ Resume delivery method :[email protected]
* Expanding reading
author | Wu Xinwei ( Storage ang )
edit | Orange King
边栏推荐
- 嵌入式常用计算神器EXCEL,欢迎各位推荐技巧,以保持文档持续更新,为其他人提供便利
- Yyds dry goods inventory C language recursive implementation of Hanoi Tower
- Michael smashed the minority milk sign
- The underlying implementation of string
- Codeforces Round #274 (Div. 2) –A Expression
- 2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
- Vit paper details
- VIP case introduction and in-depth analysis of brokerage XX system node exceptions
- Five wars of Chinese Baijiu
- Codeforces Round #274 (Div. 2) –A Expression
猜你喜欢
2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
Reptile practice (V): climbing watercress top250
Basic introduction of figure
C# 如何在dataGridView里设置两个列comboboxcolumn绑定级联事件的一个二级联动效果
PostgreSQL modifies the password of the database user
GPS from getting started to giving up (19), precise ephemeris (SP3 format)
Shake Sound poussera l'application indépendante de plantation d'herbe "louable", les octets ne peuvent pas oublier le petit livre rouge?
[Digital IC manual tearing code] Verilog automatic beverage machine | topic | principle | design | simulation
数字化转型挂帅复产复工,线上线下全融合重建商业逻辑
It's not my boast. You haven't used this fairy idea plug-in!
随机推荐
GPS从入门到放弃(十一)、差分GPS
Depth first traversal (DFS) and breadth first traversal (BFS)
Huawei has launched attacks in many industries at the same time, and its frightening technology has made European and American enterprises tremble
Oracle Performance Analysis 3: introduction to tkprof
From campus to Tencent work for a year of those stumbles!
GPS from getting started to giving up (XIII), receiver autonomous integrity monitoring (RAIM)
Run the deep network on PI and Jetson nano, and the program is killed
记一次清理挖矿病毒的过程
Uni app app half screen continuous code scanning
一行代码可以做些什么?
[Chongqing Guangdong education] Tianjin urban construction university concrete structure design principle a reference
LeetCode学习记录(从新手村出发之杀不出新手村)----1
Codeforces Round #274 (Div. 2) –A Expression
GPS从入门到放弃(十八)、多路径效应
C how to set two columns comboboxcolumn in DataGridView to bind a secondary linkage effect of cascading events
GPS from getting started to giving up (16), satellite clock error and satellite ephemeris error
Reptile practice (V): climbing watercress top250
Explain ESM module and commonjs module in simple terms
bat脚本学习(一)
jvm:大对象在老年代的分配