Huawei boss: be a happy programmer

During the Spring Festival holiday, I had a small gathering with a few friends. Everyone said that their work was smooth, safe and healthy. During this period, an old friend who had been in the business world for many years asked: "What are you doing at Huawei now?" I said proudly: "System Architect", but he was stunned for a long time, but when my wife added "Code Farmer" next to it, my old friend understood it instantly, but left my hurt heart alone and messy in the wind.

As someone of the same generation as UNIX, I chose to major in computer science simply because I learned what I got. When I graduated from undergraduate and encountered the Internet crisis, I went to graduate school without thinking. After graduation, I was looking for a job. The interviewer asked why I wanted to do software development. Stepping into the field of coding, I just never thought that it would take more than ten years to do it.

But if one thing has been done for a long time, no matter whether it is successful or not, there will be some real experience and experience. I have also read some articles on how to be successful and happy at work, such as the Malos theory, maybe because of my poor comprehension ability, the only gain is to be glad that I chose coding as my job, because coding is inherently Pleasant work content and working atmosphere, happiness is like a shadow.

Code World: The rules are simple and effective, rude but perfect

Engaging in coding can exercise logical thinking skills and teach you how to think. Just like studying law, people who study law don't necessarily want to be lawyers, but law teaches you a way of thinking. In the same way, you can learn the most rigorous way of thinking in the world through coding. Because in the world of coding, right and wrong are simple and even absolute, as long as you hit the keyboard, the computer will determine what is right and wrong, 0 or 1, the rules are simple and effective, rude but perfect.

By engaging in coding, you can gain sustained creativity. Like writing, painting, and composing, coding is a creative job. As long as you have a computer and master the basic skills, you will have unlimited super power, and you can create new things at will, enriching and beautiful the world, isn't it great?

Even cooler, coding can taste loneliness. In addition to communicating and studying with others, programmers spend most of their time working alone. As long as they touch the keyboard with both hands, their hearts will instantly become peaceful. How cool! Accompanied by the crisp murmur of the keyboard, immersed in a person's world, with the misty rain, a cup of tea, listening to the sound of the pattering rain alone and savoring loneliness, it is almost the same as the purpose, so emotional!

Most of the people who can choose coding as a job are people who like to live a simple life: this group of people has innocent curiosity, although they are unsmiling, but they are warm-hearted, good at sharing, willing to help others, and sometimes even solve problems , I would rather not sleep, but I am deeply happy... With such a group of simple and pure people, I think the best working atmosphere in the world is nothing but this.

图0:华为大佬:做一个快乐的程序员

The three realms of programmers

However, the expansion of the IT era has made coding work like a printer in the Renaissance, and the coding threshold is getting lower and lower. There are "One Week XX Quick" and "20 Days XX Proficient" everywhere. It seems that you can write code and become a programmer. It makes many people think that working in coding is a code farmer. In fact, there are many printers, but not many masters; there are many coders, but not many programmers. Programmers are not code farmers, and code farmers are not real programmers.

图1:华为大佬:做一个快乐的程序员

Programmers have three words in English: Coder, Programmer and Software Engineer. I think these three words vividly describe the three stages that programmers need to go through, or three realms-

Coder : You only need to be proficient in using the programming environment, proficient in several programming languages, development frameworks and development libraries, and be good at writing code. Programmers at this stage can complete the coding according to the established design.

Programmer : On the basis of coder, it is required to be proficient in design patterns, algorithm implementation and coding skills, and have the ability to be proficient in application. Programmers at this stage can independently code to solve real-world problems.

Software Engineer : Under the premise of mastering business knowledge, understand why it is implemented. After comprehensively considering the architecture implementation and weighing development costs, put forward the optimal solution to solve business problems, and be able to communicate with business personnel smoothly so that business personnel can understand the plan. . Only when the coding work reaches this stage can it be called a real programmer and the transition from work to career has truly been realized.

It is undeniable that there are some talented programmers in this world who have completed the above three stages of cultivation while drinking coffee and humming songs. But for the vast majority of people, it takes a lot of time and effort. Whether you can become a professional programmer depends on many factors and methodologies. Various learning and technical summaries are everywhere: active thinking, timely summarization, and planning. But I think the most important thing is being able to focus.

许多没有达到第三个阶段的程序员,就是因为受到各种因素诱惑,变得心猿意马,不够专注。因为不够专注,他们不在意做好自己本职工作,不在意锤炼自己的技能,不在意学习新兴的技术。慢慢的,他们会认为从事编码没有出路,进而毫无例外地把编程看成是体力劳动,只会粘贴拷贝代码,知其然而不知其所以然,导致技术停滞不前。在这样的状态下工作5年、10年,对于他们来说,没什么区别,程序员真的就是吃青春饭的码农。

图2:华为大佬:做一个快乐的程序员

程序员VS码农:我们不一样

要避免程序员变成码农,必须对编码保持热情,并持续学习;必须保持好奇心,乐于探求事物本质;必须对所做的工作及时总结,主动优化代码,让系统变得更加有机;必须主动尝试更好的开发方式、更先进的工具,来提升开发效率,并想办法避免重复性的工作;必须不断改进设计,将编程变成创造性的工作。只要通过这样逐步地积累经验和长时间锤炼,知识体系才能构建完备和丰富,才能避免沦落为码农。

几年前,我曾经重构过一个模块,从外部看模块的所在的系统,都是类似这样的,简洁而漂亮:

图3:华为大佬:做一个快乐的程序员

但从程序员编码实现的层面看,它实际上是这样的:

图4:华为大佬:做一个快乐的程序员

这个设计在最初的版本没有任何问题,使用继承扩展管理对象的接口能力,但仅仅过了两个版本,项目组PL说实在撑不下去了:增加一个接口,需要修改200多个地方,如果再过一个版本,估计要修改400多个地方了。

后来我把它改成这个样子,使用聚合消除了耦合:

图5:华为大佬:做一个快乐的程序员

从代码实现层面看,在功能刚开始开发时,这两个设计区别不是很大,但随着系统演进、越来越多的功能加入,继承关系带来的耦合会导致模块之间关系越来越复杂,牵一发而动全身,终究有一天哪怕只做很小的改动,也将成为压死骆驼的最后一根稻草。

这次重构的成果是代码量由43K减少到15K,扩展新的接口能力不再需要修改已有代码。我想,这或许就体现了码农和程序员的区别吧。

CT是一个业务复杂度极高的行业,要想从码农成长为程序员,需要经历更多的煎熬,需要发挥更多的创造力,同时也意味着,我们比以往任何时候都需要越来越多的码农成长为程序员。

既然我们选择了编码作为职业,注定会经历各种心劫:枯燥、沮丧、迷茫,甚至浮躁……然而无论处于哪种心境当中,我相信,只要想起自己曾经满怀惊奇、兴奋与真诚敲下的那个程序——“Hello,World!”我们就会充满了渴望和力量,因为那是程序员最初的梦想:改变世界。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325342203&siteId=291194637