当前位置:网站首页>Are these old system codes written by pigs?
Are these old system codes written by pigs?
2022-06-25 06:36:00 【Little sister taste】
original : Taste of little sister ( WeChat official account ID:xjjdog), Welcome to share , The official account is reproduced. .
Xiao Wang has joined a new company , This company is a little old , So even Shishan is fermented , It tastes very strong .
Like most unlucky programmers , In this company , Most of the work done , Is to repair these shit mountains , Add bricks and tiles to it to create a bigger Shishan . Every time I am exhausted by tossing , I can't help the turbid air in my nostrils :“ The people who designed this system , It's really rubbish ”!
Of course , The people who designed this system , May have left long ago , It could also be your immediate boss . If you are lucky enough to get a gentle - tempered elder , He will tell you with great regret :“ The system is really riddled with holes , If only we had designed it in the right way ”!
No programmer has ever regretted , It's like people who lose money regret buying stocks , People who grow up regret coming to this world .
Many people see bad code , That's all in hindsight . At the moment the code runs ,“ Can run ” That's what matters . Rotten code can enter the warehouse and be put into production , It must be caused by the lack of some links .
Bad code has its own background .
Rush for construction period
There are countless managers , Want to quantify the work of programmers , And out of that came KPI、OKR Such a tool . At some time , It may be useful , But this way of working, measured by deadlines , It will cause a large accumulation of technical debt .
Under the pressure of construction period , Few people can think about the rationality of the demand , And subsequent extensibility . Bad code before Review Under the circumstances , Lack of refactoring 、 Limited testing , They rushed to the online operation . Some designs , It can be said that it is unreasonable from the source , However, due to the need for rapid implementation , The plan has to be compromised .
Most of the time , Code that lives and dies doesn't cause much problems . But there are always some projects , Very long life cycle , There is still a lot of need for repair . Build a building in a place where the foundation is unstable , There will always be a day of collapse .
But whatever it is , As long as it's not in your own hands .
Hand training program
I even found a very interesting phenomenon . Many departments want to train new people , Some very important modules and functions , Let new people do it .
Due to lack of experience , The newcomers have many defects in the scheme design . But in terms of time cost , It is not much different from the old bird . A lot of hands-on projects , Inadvertently, it will grow into a big mac , Then the defects left by it will be magnified .
Contrary to what most people think , The newcomers are in the technical scheme , Will adopt more new technologies and exotic skills , The old bird is good at using the most basic and simple tools to complete the design . This may be a kind of utilitarianism that wants to put what we have learned into practice and vanity that pursues fashion .
Unfortunately , The code that pursues skill , There will be many conventions and specifications in it , If the project is not under unified control , Such conventions and specifications will be contrary to other conventions and specifications in the project , The code style is not uniform , Debugging difficulty , Can't expand .
Self starting stove
Many programmers are very confident , Think of yourself as english Level and coding level are particularly high , In the code, the Dragon flies and the Phoenix dances , Self starting stove .
They don't care about the conventions and norms of the entire technology community , Name the interface , foreign API I put too much effort into my work , We usually call these people brother wheel who imitates others .
such as /health Interface , I don't call health, My name is /server_status.
Another example is the error code , I must have one called success_200, A place called fail_500. The subsequent entry correction Emperor sees such an error code , Scoff but dare not change , So he made his own set 200 and 500.
Such agreement and Amendment Agreement , Will accumulate more and more under the erosion of years , So that no one knows what it is .
therefore , If you see a project with very bad code , Don't rush to revise , Be sure to follow its rotten logic . believe me , It must be more secure than your correction .
copy emperor
In many companies , You go to see their products and codes , There will be a sense of deja vu .
you 're right , They copied it .
In the absence of product design and funding , The boss gave the ultimate order .
“ According to xxx Give me a copy One , Don't let go of a button ”.
copy One and design one are two concepts ,copy It usually means simple thinking , It is much worse than the mold in terms of details and functions .
What's worse , The mold is changing . If you're not lucky , A team just copy There is a product , The next day, I opened other people's products , good heavens , They have all changed their editions .
Si Xiang and UN designed code come from this .
Of course copy Emperor also means cv The engineer , But their destructive power is limited , The initial intention is also good , It can't cause much damage .
What do I do ?
regret , At least it's good .
This is relative to people who never regret . Regret shows that he knows what is right , It is only in some special circumstances that such consequences have been caused .
If the same reincarnation is given to people who have regret experience , He will think more about the time and personnel allocation of the project . The man who never regrets may be a stubborn donkey , Or maybe he really thinks he is right , This is a very sad thing .
If you are unlucky enough to maintain these shit mountains , Remember to do what you can , Don't venture in , And don't over correct . Unless your team gives real time and people , To really shovel this shit .
These codes , Of course it wasn't written by a pig , It's just putting people in a pigsty .
Author's brief introduction : Taste of little sister (xjjdog), An official account that does not allow programmers to take turns. . Focus on infrastructure and Linux. Ten year structure , 10 billion traffic per day , Discuss the world of high concurrency with you , Give you a different taste . My personal wechat xjjdog0, Welcome to add friends , Further communication .
Recommended reading :
1. Get along well with Linux
2. What's the taste
3. Bluetooth like a dream
4. Kill a machine !
5. The lost architect , Just leave a script
6. The architect wrote BUG, Extraordinary
7. Some programmers , The essence is a flock of sheep !
边栏推荐
- [road of system analyst] collection of wrong questions in the chapters of Applied Mathematics and economic management
- What does cardinality mean in set
- cos(a-b)=cosa*cosb+sina*sinb的推导过程
- The elephant turns around and starts the whole body. Ali pushes Maoxiang not only to Jingdong
- Handling skills of SQL optimization (2)
- Asemi fast recovery diode us1m parameters, us1m recovery time, us1m voltage drop
- [no title] dream notes 2022-02-20
- How to chain multiple different InputStreams into one InputStream
- Global and Chinese benzoic acid market competition strategy and demand scale forecast report 2022
- How do I turn off word wrap in iterm2- How to turn off word wrap in iTerm2?
猜你喜欢
[data visualization application] draw spatial map (with R language code)
From file system to distributed file system
[v2.0] automatic update system based on motion step API (support disconnection reconnection and data compensation)
cos(a+b)=cosa*cosb-sina*sinb的推导过程
joda.time获取日期总结
ctfshow-misc
ACWING/2004. 错字
[road of system analyst] collection of wrong questions in the chapters of Applied Mathematics and economic management
How to create a handy vs Code?
What is the IP address
随机推荐
In depth inventory: 23 vscode plug-in artifacts that improve development efficiency and aesthetics
Analysis report on demand scale and Supply Prospect of global and Chinese thermal insulation materials market during the 14th Five Year Plan period 2022-2028
Global and Chinese medical protective clothing market supply and demand research and investment value proposal report 2022-2028
At the age of 26, I was transferred to software testing with zero foundation. Now I have successfully entered the job with a monthly salary of 12K. However, no one understands my bitterness
What is cloud primordial?
Es11 new methods: dynamic import(), bigint, globalthis, optional chain, and null value merging operator
What is the slice flag bit
Self adjustment process of MySQL index tree when adding data
十大券商公司哪个佣金最低,最安全可靠?有知道的吗
@Detailed explanation of valid annotation usage
Brief introduction and use of JSON
An interview question record about where in MySQL
Exercise: completion
Socket, network model notes
Analysis report on production and sales demand and sales prospect of global and Chinese phosphating solution Market 2022-2028
System dilemma and software complexity: Why are our systems so complex?
Investment opportunities and operational risk assessment report of China's engineering consulting industry during the 14th Five Year Plan period 2022-2028
Explain @builder usage
ARM processor operating mode
Comparison test of mono 120W high power class D power amplifier chip cs8683-tpa3116