当前位置:网站首页>Having written code in Huawei for more than ten years, a programmer's self-cultivation
Having written code in Huawei for more than ten years, a programmer's self-cultivation
2022-06-09 16:52:00 【Lixiaoyao】
Focus on 、 Official account of star standard , Straight to the highlights
Self cultivation of a programmer
Xu Hongwei
One night , I chat with my wife , Said the Department asked me to write a “ Big talk about software ” The article , My wife gave me a squint , Lightly say :“Linus A great god 21 At the age of, he wrote Linux The rudiment of the kernel , Created a liberal open source world ; Xiao-long zhang 28 Years old foxmail, stay 2000 Sold in 1200 The price of all . higher-ups , I've known you so long , I don't know much about your outstanding achievements ?” I swallowed in a chat :“ ok , I reorganize the language , I need to write an article about software ……”
Looking back on the past half year , Chief software engineer 、 Appointment of software experts , Let us software engineers who have written code for more than ten years be excited . I 2006 Entered the company in , Almost participated in Huawei 3G The complete life cycle of the controller product , Witness Huawei 3G From the beginning 、 rising 、 Improvement in the soul 、 peak 、 The magnificent course of falling back , And in 35 year “ - ” It's my pleasure to join in 5G The big family of the development department .
For more than a decade , I've been sticking to coding , Experienced ordinary developers 、TL、MDE、MDEL、SDM( Cloud team )、Committer、 Software experts and other positions . But I know very well , I'm not a big bull , Engage in coding this “ High-risk ” A career of more than ten years without being taken away “ Sacrifice to heaven ”, It depends on the self-cultivation of a programmer —— Solid basic software capabilities 、 Working attitude like walking on thin ice 、 The relentless pursuit of technology .
What does good code look like
Remember a few years ago, the Department first selected excellent code , I became “ Gold code Award ” One of the winners . Is it because the code is so cool ? Not at all . The code I participated in the selection , Following simple principles : concise 、 Clear logic 、 Single function responsibility 、 Reasonable data structure design . No deep coding techniques , There is no such and such design pattern . As the company's latest C/C++ Language programming specifications , It is also the first thing to write simple programs . concise 、 Logical code , Easy to read and maintain , This code is also modified due to changes in requirements , But it has never introduced online problems .
Of course , Simple doesn't mean no thinking , On the contrary , We need to plan before we write the code 、 look before you leap . Once the project team asked me to do performance optimization , By analyzing the hot spot function repeatedly 、 Repeated tests compare the performance differences under different traffic models , Before and after spending 3 For a week , I've found the most critical factor causing performance degradation . Finally, I decided to use the modified backup mechanism 、 Optimization measures to reduce backup data . These program code changes are very small 、 It's simple , But the actual optimization effect is very good , Meet the needs of business development in the next few years .
Let's take another example , After upgrading the new version of a game point CPU The problem of load rise . After nearly two weeks of research , My final position is that the new version adds direct reading in the business process DB Operation of kernel . Direct reading DB kernel , Code handling is simple , It can also realize normal business functions , But the performance is very poor . If we can think about more in the development process , Adopt the scheme of cache , There will be a big difference in performance , Better code, too .
It is often said that the only constant is change , Customer demand has been changing , Our code will change passively or actively . Design scalable 、 Software architecture that automatically adapts to the changing needs of customers , Is the eternal pursuit of software engineers . It's easy to say , It's hard to do . We need to keep accumulating business knowledge , Expand your knowledge , Diligent in thinking , Identify the future evolution trend of Technology . We can't build an omnipotent architecture from the beginning , To encompass the myriad changes of the future , Even if it can , The delivery rhythm does not necessarily allow . Design to meet current and future business needs in a certain period of time , Maybe it's the most appropriate .
Practice solid basic skills
Can write good code , It's more important to be able to write good code continuously , We need to have a deep understanding of technical principles and business logic . The premise is to have a solid programming foundation , That is, basic software capabilities , Such as the basic data structure and algorithm 、 Compilation principle, etc .
At the end of last year , I'm with a few software experts in the Department , Went outside to attend an Internet architecture Conference .AI、 Blockchain 、 The Internet of things 、 cloud 、 Middleware and other fashion 、 hotspot 、 There are many issues related to tuyeres . But I didn't expect , The most popular is some basic software design 、 Topics like architecture design and evolution . Just like the martial arts novels , Practice basic skills 、 Improve internal skill , Follow up no matter what subtle moves , It's all at your fingertips .
in addition , Some programming habits , If you keep going , It is also very useful for the improvement of programming accomplishment . For example, the use of shortcut keys 、 Valid code comments 、 Naming rules 、 Code style, etc . Every time I write code, besides pursuing good code , I always think about software optimization , Can you use less memory , Can it have better performance . Value every field in the data structure , Pay attention to every small code optimization , Can bring us unexpected results . For example, we did performance optimization last year , We just change a dynamic memory request in the process to a static memory pool , By accident 30 CAPS( Number of calls per second ) Performance improvement of .
One line of code caused the tragedy
Someone asked , I know everything , Why still can't write good code ?
Many developers , Because of personal habits 、 Rush deadlines 、 External requirements are not high for many reasons , Very casual when programming , direct Copy-Paste. I think programmers should pursue quality of life , Get into the habit of programming that doesn't work 、 Rigorous programming attitude .
For code on the library , I've always been trembling , to be very careful . Before I go to the library, I will read the modified code repeatedly , Look at the context of changing the code , Code comparison before and after modification . Look at the code a few times after it goes to the library , Make sure that all are in as expected . So many years in the company , I've never been more together 、 Leakage and closure 、 Any line of code has been misspelled .
You may think I'm making a mountain out of a molehill , But in fact , These are all painful lessons that have happened in history . After upgrading the new version in a certain country, we found that the user access success rate deteriorated , The last location is caused by a line of code being deleted by mistake . Go back after the fact , Developers themselves don't remember why this line of code was deleted . Another time , A line of code was deleted by mistake , Lead to a key KPI indicators : The number of soft switch statistics has changed . The Department summed up the two incidents as “ One line of code caused the tragedy ”, Whether it's for product brands 、 Customer impression 、 Or for individuals , It's all bad .
After the event, everyone was thinking , We have pair programming 、 Code view 、 Developer self testing and other very perfect development process , also MDE( Module designer ) View as before code on the library “ goalkeeper ”, Why would such a low-level mistake happen ? The process was not implemented in place , still MDE Neglect 、 It's not good ?
stay IPD 2.0 Changing , The company borrows from the open source organization Committer operation , To strengthen our Committer Mechanism and culture .5G Development department also selects 、 A number of... Have been appointed Committer, I'm lucky to be one of them . Just started to fulfill Committer When it comes to duty , I'm a little confused : This is not for MDE The characters put on a new coat , hold MDE The original “ In private ” Do the things , adopt Committer Do you want to show the statistics ?
however , After months of groping 、 After practice , I come to understand ,Committer The mechanism should be a cultural change , Lead everyone to improve their software capabilities .Committer A lot of responsibilities , As the last checkpoint before code submission , This is effective at the current stage of insufficient personnel capacity , But a practice that should be weakened in the end . Participate in software design before coding 、 Continue to do a good job in structural care and technical debt clearing , Let everyone have a greater chance to write better code , I think this is Committer Greater value .
As individuals and organizations improve their software engineering capabilities , After the completion of automatic test of protective net and change of protective wall construction , aforementioned “ One line of code caused the tragedy ”, It can be avoided .
“ Change the protective wall ” Not reliable enough
For most old employees , Especially wireless 2G/3G/4G Wait for the old staff of the Department to say , When it comes to change control , They will be like enemies . After version upgrade ,KPI Variation is absolutely not allowed , If it is serious, it may face version fallback 、 Customer complaints and reported accidents . and KPI Better , In addition to explaining , There are also business risks , Customers will feel that they have suffered losses before . The real world is so hard on us , Who makes us communication software engineers who influence the world , This is the depth of their love 、 It's a matter of responsibility !
We develop a version of , It often involves hundreds of thousands of new code 、 Modify or refactor . If you don't want to introduce change issues , Besides doing a good design 、 Pair coding 、 Beyond code review and testing , I think the most important thing is the perfect automatic protective net . stay 3G when , I took two colleagues with me to IT Test engineering has expanded from just a few hundred use cases to tens of thousands of use cases . Full coverage of the scene 、 Strict cell validity check 、 Perfect use case failure decision mechanism 、 No dead corner of the resources leakage inspection and other means , Let the error of change be hidden , to 3G Left a change wall .
During the development process, add IT and PC-ST The test case , Not to improve code coverage , It's for automated protection . And to achieve the premise of automatic protection , Every use case has perfect validity check , Otherwise, the protective net is nothing . A few years ago , I was joking with a colleague :“ I will deliberately correct a line of code , See if your supplementary use cases can check out .” To my surprise , In case of tight delivery , He still spent half a day perfecting the use case validity check , And ask me to deliberately change the wrong code to do experiments . Of course , The end result is , He is well prepared , I didn't find the problem . What a self seeking programmer !
Keep curious about new technologies
Speaking of the pursuit of programmers , I think of 2016 Participated in a product cloud project in , I'm in charge of the design of elastic expansion properties . Before that , I've been working on embedded software development , Although during the product also changed several generations of hardware , Experienced product and platform decoupling 、 Decoupling between systems 、 Software and hardware decoupling process , But for service 、 Micro service 、 Cloud and other concepts , I'm basically in a state of ignorance .
I don't know what to do , Can only be “ Standing on the shoulders of giants , For my use ”. Isn't brother's product line already done , Then ask them to help you ; Isn't it true that friendly businessmen have road signs and plans , Then look for references in their limited materials ; Amazon cloud on the Internet 、 Isn't there a very mature solution for Alibaba cloud , Download their product manuals and user guides …… At that time, I felt like I was possessed , Crazy learning about distributed software technology , Crazy to absorb all kinds of energy for my use , In the end, I give a design scheme which satisfies myself and the project .
It also made me fully aware of my previous focus on the product 、 System 、 Shortcomings of the subsystem .
As a programmer , In addition to improving their basic software capabilities , We should also always be curious about emerging technologies , The relentless pursuit of , Keep broadening your horizons . And the ability and appeal in this respect , stay 5G This is especially true of the times .
At present, Huawei 5G The problem of network security , Although there are a lot of political factors , But it also reflects 5G Strategic significance of . Hypervelocity rate 、 Over Dalian 、 Ultra high reliability and low delay , For us in software processing delay 、 reliability 、 Security 、 Toughness and other aspects of the ability to put forward higher requirements . meanwhile ,5G Carrying vertical industry applications 、 Interface opening and hardware “ White box ” Wait for the trend , It will also have a positive impact on our current knowledge and technology system , Make a bigger challenge .
The company plans to spend five years , Improve the ability of software engineering , It's a test for us , It's also an opportunity . Unified programming specifications 、 Tidiness code 、 Neat and elegant architecture , Different people have different pursuits , We need to be persistent 、 The determination of water dripping through stone . Five or ten years later , When we look back , You will find that what you have paid is worth it . just as , Wang Guowei, a famous scholar in the Qing Dynasty, proposed the third realm of the three realms of reading :“ looking for her for thousand times in the crowd , Suddenly look back , The man was in the dim light .”
Maybe most of us will never be Linus、 Zhang Xiaolong is such a great God . However , We can be a cultured programmer , And participate in Huawei, which changes the world 5G In product development , Leave your own excellent code in the history of human communication , Fortunately .
This article is from 《 Huawei people 》, Reprint please indicate the source .
Copyright notice : Source network of this paper , Free delivery of knowledge , The copyright belongs to the original author . If involves the work copyright question , Please contact me to delete .
‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧ END ‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧
Pay attention to my WeChat official account , reply “ Add group ” Join the technical exchange group according to the rules . Click on “ Read the original ” See more sharing , Welcome to share 、 Collection 、 give the thumbs-up 、 Looking at 边栏推荐
- Top level templates (including contract, tender, graduation defense and other templates in all aspects of work)
- 虚幻引擎插件 - Maya LiveLink - 安装和使用
- Jpex launches bayc mayc contract series welcome experience
- 检测ip地址库内是否存在指定的ip
- Install MySQL 5.7 server under windows (full of holes)
- What if win10 cannot find the flight mode switch?
- 问题 D: 马走日
- Querylist asynchronously fetches web page data
- 天呐,嘉立创的单、双面板又又又降价了,同行还怎么玩儿?
- 二战陷入这4点误区,再来一年也白搭!
猜你喜欢

Browser fingerprint interpretation

Detailed explanation of toolbar buttons in the user interface of autorunner automated test tool -alltesting | Zezhong cloud test

Leetcode 1967. 作为子字符串出现在单词中的字符串数目

What if win10 cannot find the flight mode switch?

Still building projects from scratch? This upgraded rapid development scaffold is worth a try~

Vulnstack series range I

Merge MP4 files with ffmpeg
![[ctfshow singles cup]web writeup & learn the basic usage of SED awk](/img/e6/c0ce483e091ba03f81667dacc04c3b.png)
[ctfshow singles cup]web writeup & learn the basic usage of SED awk

Penetration test - post penetration +lcx+frp

AutoRunner自动化测试工具用户界面之工具栏按钮详解-Alltesting|泽众云测试
随机推荐
Vulnstack series range I
Sphereex officially open source the database mesh oriented solution pisanix
Elk is not fragrant! I use grayog, which is much lighter
My eclipse 连接数据库
Linux runs shengxunwei online customer service system: implementation method of supporting SQL server and MySQL at the same time
Leetcode 1979. 找出数组的最大公约数
ELK 不香了!我用 Graylog,轻量多了....
UEditor圖片跨域上傳解决方案
Close the privacy collection window of stackexchange and other platforms
虚幻引擎插件 - Maya LiveLink - 安装和使用
ArcGIS Pro优化方法
[go language learning] structure practice
不看后悔,appium自动化环境完美搭建
Usage of dac8560
Zhongyuan bank unified log platform
关于在C#中因没有添加:mysql.data.dll 而报错这件事
Execution strategy of application software efficiency test
How to solve warning: there was an error checking the latest version of pip
【经验分享】Django开发中常用到的数据库操作总结
Penetration test - post penetration +lcx+frp
