20 年工程生涯的 20 条经验,作者先标注了适用边界
Simple Thread 联合创始人回顾 20 年工程生涯,先交代自己的经验边界:前半段在小公司和创业团队,之后做咨询接触大企业,再把公司从 2 人带到 25 人,因此这些判断都带有『人少、要交付、还要维护老系统』的前提。文中 20 条多半反直觉:最难的是做对的东西而非写好代码;最好的代码是不用写的代码;系统终将变烂,该追求可持续改进而非完美;10x 程序员是神话,真正该做的是别让 0.1x 程序员进团队;数据比代码库活得更久;面试几乎无法预测一个人是否是好的队友;技术选型要看存活多年的『鲨鱼』而非新潮工具。适合希望校准自己工程判断的一线开发者,也可当团队讨论素材。


Important, Read This First
You’re about to read a blog post with a lot of advice. Learning from those who came before us is instrumental to success, but we often forget an important caveat. Almost all advice is contextual, yet it is rarely delivered with any context.
“You just need to charge more!” says the company who has been in business for 20 years and spent years charging “too little” to gain customers and become successful.
“You need to build everything as microservices!” says the company who built a quick monolith, gained thousands of customers, and then pivoted into microservices as they started running into scaling issues.
重要,请先读这段
你接下来要读的是一篇满是建议的文章。向先行者学习对成功至关重要,但我们常常忘记一个重要前提:几乎所有的建议都离不开具体语境,可人们却很少在给出语境的情况下把它讲出来。
“你只要把价格提上去就行了!”说这话的公司做了 20 年生意,早年为了拉客户、把生意做成,长年把价格定得“太低”。
“一切都该拆成微服务!”说这话的公司当初快速搭了个单体应用,攒下几千客户,等到开始撞上扩展瓶颈,才转向微服务。
Without understanding the context, the advice is meaningless, or even worse, harmful. If those folks had followed their own advice early on, they themselves would likely have suffered from it. It is hard to escape this trap. We may be the culmination of our experiences, but we view them through the lens of the present.
不了解语境,建议就没有意义,甚至更糟——有害。如果那些人早年真照自己这套建议去做,多半会自食其果。这个陷阱很难躲开:我们或许是自己全部经历的集合,可回看时,用的却是当下的视角。
So to give you a little context on where my advice comes from, I spent the first half of my career as a software engineer working for various small businesses and startups, then I went into consulting and worked in a number of really large businesses. Then I started Simple Thread and we grew from a team of 2 to a team of 25. 10 years ago we worked with mostly small/medium businesses, and now we work with a mix of big and small businesses.
所以,先交代一下我的建议从何而来:职业生涯前半段,我在各种小公司和创业公司做软件工程师;后来转去做咨询,服务过不少体量很大的企业。再后来我创办了 Simple Thread,团队从 2 人长到 25 人。10 年前,我们的客户以中小型企业为主;如今大大小小的公司都有。
My advice is from someone who…
- has almost always been on small, lean teams where we have to do a lot with very little.
- values working software over specific tools.
- is starting new projects all the time, but also has to maintain a number of systems.
- values engineer productivity over most other considerations
My experiences over the last 20 years have shaped how I view software, and have led me to some beliefs which I’ve tried to whittle down to a manageable list that I hope you find valuable.
On with the list
我的建议来自这样一个人……
- 几乎一直在人手精简的小团队里,用很少的资源做成很多事。
- 看重能跑起来的软件,而不是某个具体工具。
- 一直在开新项目,同时还得维护好几套系统。
- 把工程师的效率看得比大多数其他考量都重。
过去 20 年的经历塑造了我看待软件的方式,也让我形成了一些信念。我尽量把它们压缩成一份还读得完的清单,希望对你有所帮助。
下面进入正题。
“How can you not know what BGP is?” “You’ve never heard of Rust?” Most of us have heard these kinds of statements, probably too often. The reason many of us love software is because we are lifelong learners, and in software no matter which direction you look, there are wide vistas of knowledge going off in every direction and expanding by the day. This means that you can spend decades in your career, and still have a huge knowledge gap compared to someone who has also spent decades in a seemingly similar role. The sooner you realize this, the sooner you can start to shed your imposter syndrome and instead delight in learning from and teaching others.
“你怎么会不知道 BGP?”“Rust 你都没听过?”这类话我们大多都听过,而且恐怕听得太多。很多人热爱软件,正是因为我们一辈子都在学习:在软件世界里,无论往哪个方向看,都是不断向外铺展、每天都在扩张的知识疆域。这意味着,哪怕你干了二十年,跟另一位看似做着类似工作、同样干了二十年的人相比,知识盲区依旧可能巨大。越早意识到这一点,你就越早能摆脱冒名顶替综合征,转而享受向别人学习、也教别人的过程。
I know this is cliche at this point, but the reason most software engineers don’t believe it is because they think it devalues their work. Personally I think that is nonsense. Instead it highlights the complexity and irrationality of the environments in which we have to work, which compounds our challenges. You can design the most technically impressive thing in the world, and then have nobody want to use it. Happens all the time. Designing software is mostly a listening activity, and we often have to be part software engineer, part psychic, and part anthropologist. Investing in this design process, whether through dedicated UX team members or by simply educating yourself, will deliver enormous dividends. Because how do you really calculate the cost of building the wrong software? It amounts to a lot more than just lost engineering time.
我知道这话已经是老生常谈,但大多数软件工程师之所以不信,是因为觉得它贬低了自己的工作。我倒觉得这是无稽之谈。恰恰相反,它点出的是我们所处环境的复杂与不合理,而这些又让挑战成倍放大。你可以设计出全世界技术上最惊艳的东西,然后没人愿意用——这种事天天发生。设计软件本质上是一项倾听的工作,我们常常得一半是软件工程师,一半是通灵者,一半是人类学家。在设计上投入——无论是配备专职 UX 人员,还是自己补课——回报都极其可观。因为建错软件的成本究竟该怎么算?它远不止浪费掉的那点工程时间。
Great software engineers think deeply about the user experience of their code. They might not think about it in those terms, but whether it is an external API, programmatic API, user interface, protocol, or any other interface; great engineers consider who will be using it, why it will be used, how it will be used, and what is important to those users. Keeping the user’s needs in mind is really the heart of good user experience.
优秀的软件工程师会深入思考自己代码的使用体验。他们未必用“用户体验”这个词去想,但无论是外部 API、程序化 API、用户界面、协议还是别的什么接口,优秀的工程师都会考虑:谁会用它、为什么用、怎么用,以及对这些使用者来说什么才是重要的。把使用者的需求放在心上,正是良好体验的核心。
All I have to say is “coders gonna code.” You ask someone in any profession how to solve a problem, and they are going to err on the side of what they are good at. It is just human nature. Most software engineers are always going to err on the side of writing code, especially when a non-technical solution isn’t obvious. The same goes for code you don’t have to maintain. Engineering teams are apt to want to reinvent the wheel, when lots of wheels already exist. This is a balancing act, there are lots of reasons to grow your own, but beware of toxic “Not Invented Here” syndrome.
我要说的就一句:“写代码的人总想写代码。”你问任何行业的人怎么解决问题,他们都会倾向于用自己擅长的方式——这是人性。大多数软件工程师也总是倾向于写代码,尤其是在非技术方案不那么明显的时候。不用自己维护的代码也一样:明明现成的轮子一大把,工程团队还是容易想着重造一个。这是个平衡问题:自研有很多理由,但要提防“非我发明”这种有毒心态。
The primary job of any software engineer is delivering value. Very few software developers understand this, even fewer internalize it. Truly internalizing this leads to a different way of solving problems, and a different way of viewing your tools. If you really believe that software is subservient to the outcome, you’ll be ready to really find “the right tool for the job” which might not be software at all.
任何软件工程师的首要工作都是交付价值。很少人真正懂这一点,真正把它内化的人更少。真把它内化,你解决问题的方式会不一样,看待工具的方式也会不一样。如果你真心相信软件要服务于结果,你就会愿意去找“适合这件事的工具”——而那可能根本就不是软件。
Some people tend to jump into problems and just start writing code. Other people tend to want to research and research and get caught in analysis paralysis. In those cases, set a deadline for yourself and just start exploring solutions. You’ll quickly learn more as you start solving the problem, and that will lead you to iterate into a better solution.
有些人一遇到问题就扑上去写代码。另一些人则研究、再研究,最后陷进分析瘫痪。这两种情况下,都给自己定个截止时间,然后直接开始试方案。你在解决问题的过程中会迅速学到更多,也会因此迭代出更好的方案。
This is something I struggle with a lot as my responsibilities take me further and further from the day to day of software engineering. Keeping up with the developer ecosystem is a huge amount of work, but it is critical to understand what is possible. If you don’t understand what is possible and what is available in a given ecosystem then you’ll find it impossible to design a reasonable solution to all but the most simple of problems. To summarize, be wary of people designing systems who haven’t written any code in a long time.
随着职责把我带得离日常软件工程越来越远,这一点我挣扎得厉害。跟上开发者生态是巨大的工作量,但搞清楚现在能做什么至关重要。如果你不了解某个生态里什么是可能的、有什么现成的,那么除了最简单的问题之外,你根本设计不出合理的方案。一句话总结:对那些很久没写过代码、却在设计系统的人,留个心眼。
Bjarne Stroustrup has a quote that goes “There are only two kinds of languages: the ones people complain about and the ones nobody uses”. This can be extended to large systems as well. There is no “right” architecture, you’ll never pay down all of your technical debt, you’ll never design the perfect interface, your tests will always be too slow. This isn’t an excuse to never make things better, but instead a way to give you perspective. Worry less about elegance and perfection; instead strive for continuous improvement and creating a livable system that your team enjoys working in and sustainably delivers value.
Bjarne Stroustrup 有句话:“语言只有两种:被人抱怨的,和没人用的。”这话同样适用于大型系统。没有“正确”的架构,你的技术债永远还不完,接口永远设计不到完美,测试永远太慢。这不是让你什么都别改进,而是给你一个视角:少纠结优雅和完美,转而追求持续改进,做一个住得舒服、团队愿意在里面干活、还能持续交付价值的系统。
Take any opportunity to question assumptions and approaches that are “the way things have always been done”. Have a new team member coming on board? Pay attention to where they get confused and what questions they ask. Have a new feature request that doesn’t make sense? Make sure you understand the goal and what is driving the desire for this functionality. If you don’t get a clear answer, keep asking why until you understand.
抓住一切机会去质疑那些“一直以来就这么做”的假设和做法。有新人入职?留意他在哪里犯迷糊、问了什么问题。收到一个说不通的 feature request?先把目标和背后的动机搞清楚。如果得不到明确答案,就一直问为什么,直到问明白。
The 10x programmer is a silly myth. The idea that someone can produce in 1 day what another competent, hard working, similarly experienced programmer can produce in 2 weeks is silly. I’ve seen programmers that sling 10x the amount of code, and then you have to fix it 10x the amount of times. The only way someone can be a 10x programmer is if you compare them to 0.1x programmers. Someone who wastes time, doesn’t ask for feedback, doesn’t test their code, doesn’t consider edge cases, etc… We should be far more concerned with keeping 0.1x programmers off our teams than finding the mythical 10x programmer.
“10x 程序员”是个愚蠢的神话。说一个人一天能做出另一个同样能干、同样努力、经验相当的工程师两周的产出,这很荒唐。我见过写代码速度是别人 10 倍的人,然后你得花 10 倍的时间去修那些代码。一个人之所以显得像 10x,唯一的原因就是拿来对比的是 0.1x 的人——浪费时间、不主动要反馈、不测代码、不考虑边界情况……相比寻找神话里的 10x 程序员,我们更该花心思的是别让 0.1x 的人留在团队里。
Nothing worries me more than a senior engineer that has no opinion of their tools or how to approach building software. I’d rather someone give me opinions that I violently disagree with than for them to have no opinions at all. If you are using your tools, and you don’t love or hate them in a myriad of ways, you need to experience more. You need to explore other languages, libraries, and paradigms. There are few ways of leveling up your skills faster than actively seeking out how others accomplish tasks with different tools and techniques than you do.
一个资深工程师如果对自己的工具、对怎么构建软件毫无观点,那是最让我担心的。我宁愿听到我强烈反对的观点,也不愿对方什么观点都没有。如果你在用这些工具,却对它们没有一大堆爱恨,那说明你见识得太少。你需要去了解别的语言、别的库、别的范式。想快速提升水平,很少有比主动去看别人用不同工具和技术怎么做同一件事更有效的办法。
People talk about innovation a whole lot, but what they are usually looking for is cheap wins and novelty. If you truly innovate, and change the way that people have to do things, expect mostly negative feedback. If you believe in what you’re doing, and know it will really improve things, then brace yourself for a long battle.
人们大谈创新,但通常想要的只是便宜的战果和新奇感。如果你真的创新,改变了人们做事的方式,那要做好准备:反馈多半是负面的。如果你相信自己做的事,也知道它确实能带来改进,那就准备好打一场持久战。
I’ve seen a lot of systems where hope was the primary mechanism of data integrity. In systems like this, anything that happens off the golden path creates partial or dirty data. Dealing with this data in the future can become a nightmare. Just remember, your data will likely long outlive your codebase. Spend energy keeping it orderly and clean, it’ll pay off well in the long run.
我见过很多系统,数据完整性主要靠“但愿没事”。在这样的系统里,只要偏离了正常路径,就会产生残缺或脏数据,日后处理起来会变成噩梦。记住:数据的寿命多半比代码库长得多。花力气让它有序、干净,长期来看回报丰厚。
Old technologies that have stuck around are sharks, not dinosaurs. They solve problems so well that they have survived the rapid changes that occur constantly in the technology world. Don’t bet against these technologies, and replace them only if you have a very good reason. These tools won’t be flashy, and they won’t be exciting, but they will get the job done without a lot of sleepless nights.
那些留存下来的老技术是鲨鱼,不是恐龙。它们把问题解决得足够好,所以能在技术世界持续不断的剧变中活下来。别跟这些技术对赌,除非有非常充分的理由,否则不要替换它们。它们不炫、不激动人心,但能把活干完,让你少熬很多夜。
There are a lot of software engineers out there who won’t express opinions unless asked. Never assume that just because someone isn’t throwing their opinions in your face that they don’t have anything to add. Sometimes the noisiest people are the ones we want to listen to the least. Talk to the people around you, seek their feedback and advice. You’ll be glad you did.
有很多软件工程师,不问就不发表意见。别以为一个人没把观点甩到你脸上,他就没什么可补充的。有时候最吵的人恰恰是我们最不该听的。去和身边的人聊,主动问他们的反馈和建议,你会庆幸自己这么做了。
Software engineers should regularly blog, journal, write documentation and in general do anything that requires them to keep their written communication skills sharp. Writing helps you think about your problems, and helps you communicate those more effectively with your team and your future self. Good written communication is one of the most important skills for any software engineer to master.
软件工程师应该坚持写博客、写日志、写文档,总之做任何能让自己书面表达能力保持锋利的事。写作帮你理清问题,也帮你更有效地与团队、与未来的自己沟通。良好的书面表达,是软件工程师最该掌握的重要技能之一。
Everyone wants to be agile these days, but being “agile” is about building things in small chunks, learning, and then iterating. If someone is trying to shoehorn much more into it than that, then they’re probably selling something. It isn’t to say that people don’t need accountability or help to work this way, but how many times have you heard someone from your favorite tech company or large open source project brag about how great their Scrum process is? Stay lean on process until you know you need more. Trust your team and they will deliver.
如今人人都想“敏捷”。但敏捷的本质是把事情切成小块做、从中学习、然后迭代。如果谁想往里面硬塞远超这些的东西,那他多半是在卖东西。这并不是说人们不需要责任约束或帮助才能这样工作,但你听过几次你最喜欢的科技公司或大型开源项目的人吹嘘自己的 Scrum 流程有多棒?在明确需要更多流程之前,尽量保持精简。信任你的团队,他们自会交付。
If you divorce someone from the output of their work, they will care less about their work. I see this almost as a tautology. This is the primary reason why cross-functional teams work so well, and why DevOps has become so popular. It isn’t all about handoffs and inefficiencies, it is about owning the whole process from start to finish, and being directly responsible for delivering value. Give a group of passionate people complete ownership over designing, building, and delivering a piece of software (or anything really) and amazing things will happen.
如果让一个人与自己的工作成果脱钩,他就会对自己的工作少一分在意。这在我看来几乎是同义反复。跨职能团队之所以运转良好、DevOps 之所以流行,主要原因就在这里。关键不在交接和低效,而在于从头到尾拥有整个流程,并直接为交付价值负责。把一款软件(其实做任何事都一样)的设计、构建和交付完整交给一群热情的人,会出现神奇的结果。
Interviews are far better spent trying to understand who someone is, and how interested they are in a given field of expertise. Trying to suss out how good of a team member they will be is a fruitless endeavor. And believe me, how smart or knowledgable someone is is also not a good indicator that they will be a great team member. No one is going to tell you in an interview that they are going to be unreliable, abusive, pompous, or never show up to meetings on time. People might claim they have “signals” for these things… “if they ask about time off in the first interview then they are never going to be there!” But these are all bullshit. If you’re using signals like these you’re just guessing and turning away good candidates.
面试真正该花时间的地方,是搞清对方是谁、对某个专业领域的兴趣有多浓。想靠面试摸清他会是多好的团队成员,纯属徒劳。而且相信我,一个人多聪明、知识多渊博,同样不能说明他会是好的团队成员。没有人会在面试里告诉你自己不可靠、爱骂人、自大,或者从来不准时开会。有人会说他们有识别这些的“信号”……“如果他在一面就问休假,那以后肯定见不着人!”这些都是扯淡。用这种信号,你只是靠猜,然后把好候选人拒之门外。
There are a lot of forces that will push you to build the bigger system up-front. Budget allocation, the inability to decide which features should be cut, the desire to deliver the “best version” of a system. All of these things push us very forcefully towards building too much. You should fight this. You learn so much as you’re building a system that you will end up iterating into a much better system than you ever could have designed in the first place. This is surprisingly a hard sell to most people.
有很多力量会推着你一上来就把系统做大:预算要花出去、砍不掉哪些 feature 决断不了、想交付系统的“最佳版本”。这些都逼着我们做得太多。你要抵抗它。在建系统的过程中你会学到太多东西,最终迭代出来的系统,会比你一开始能设计出的任何版本都好得多。这一点对大多数人来说出奇地难以推销。
So there you have it, 20 years of software distilled down into 20 pithy pieces of wisdom. I’d love to hear it if something resonated with you. I’d also love to hear if you have a piece of wisdom that you’ve picked up over your career that you’d like to share. Feel free to leave it down in the comments.
Loved the article? Hated it? Didn’t even read it?
We’d love to hear from you.
Reach Out
以上就是把 20 年软件生涯浓缩成的 20 条精炼心得。如果有哪条让你有共鸣,我很想听。如果你也想分享职业生涯中总结出的某条心得,同样欢迎。欢迎在评论区留言。
喜欢这篇文章?讨厌它?还是根本没读?
我们都想听听你的想法。
联系我们