How to be an Excellent Programmer for Many Years

Posted on

How to be an Excellent Programmer for Many Years

(Excellent==Successful. Money & fame are more difficult to control.)

  1. Choose a small subset of available technology, learn it intimately, and embrace it. Then evolve that subset.

  2. Understand the pros and cons of various data structures, both in memory and on disk.

  3. Understand the pros and cons of various algorithms.

  4. Understand your domain. Get away from your computer and do what your users do.

  5. Be ready, willing, & able to deep dive multiple levels at any time. You must know what's going on under the hood. There is a strong correlation between "number of levels of deepness understood" and "programming prowess".

  6. Use your imagination. Always be asking, "Is there a better way?" Think outside the quadralateral. The best solution may be one that's never been taken.

  7. Good programmer: I optimize code. Better programmer: I structure data. Best programmer: What's the difference?

  8. Structure your data properly. Any shortcomings there will cause endless techincal debt in your code.

  9. Name things properly. Use "Verb-Adjective-Noun" for routines and functions. Variables should be long enough, short enough, and meaningful. If another programmer cannot understand your code, you haven't made it clear enough. In most cases, coding for the next programmer is more important than coding for the environment.

  10. Decouple analysis from programming. They are not the same thing, require different personal resources, and should be done at different times and places. If you do both at the same time, you do neither well. (I like to conduct analysis without technology at the end of the day and start the next morning programming.)

  11. Never use early exits. Never deploy the same code twice. Never name a variable a subset of another variable. You may not understand these rules and you may even want to debate them. But once you start doing them, it will force you to properly structure your code. These things are all crutches whose use causes junior programmers to remain junior.

  12. Learn how to benchmark. Amazing what else you'll learn.

  13. Learn the difference between a detail (doesn't really make that much difference) and an issue (can end the world). Focus only on issues.

  14. Engage your user/customer/managers. Help them identify their "what". Their "how" is not nearly as important.

  15. Write a framework, whether you ever plan to use it or not. You'll learn things you'll never learn any other way.

  16. Teach others what you know, either in person or in writing. You'll accidently end up teaching yourself, too.

  17. Always tell your customer/user "yes", even if you're not sure. 90% of the time, you'll find a way to do it. 10% of the time, you'll go back and apologize. Small price to pay for major personal growth.

  18. Find someone else's code that does amazing things but is unintelligible. Refactor it. Then throw it away and promise yourself to never make the same mistakes they made. (You'll find plenty.)

  19. Data always > theory or opinions. Learn the data by building stuff.

  20. At some point, run your own business (service or product). You will learn things about programming that you'll never learn as an employee.

  21. If you don't love your job, find another one. 来源: [https://news.ycombinator.com/item?id=4626515](https://news.ycombinator.com/item?id=4626515) 译文:

程序员如何保持优秀

  1. 小范围的选择一些有用技术,透彻的学习它们,拥抱它们。然后不断的扩展这个范围。

  2. 理解各种数据结构的优点和缺点,包括它们在内存中和在硬盘上的各自表现。

  3. 理解各种算法的优点和缺点。

  4. 了解你的工作领域。关上电脑,去做你的用户们在做的事。

  5. 有准备,有愿望,有能力在任何时候投入到多种技术层面中。你必须知道表象下的技术原理。在“各个技术层面的掌握程度”和“编程能力”上有着密切的联系。

  6. 发挥你的想象力。永远都要问,“有更好的方法吗?”跳出常规思维约束。最好的解决方案也许还没有被发现。

  7. 优秀程序员:我优化代码。更优秀程序员:我设计数据。最优秀程序员:他们的不同之处是什么?

  8. 正确的构造你的数据。任何的缺陷都将造成你的代码里无尽的技术债务。

  9. 正确的命名事物。使用“动词-形容词-名词”格式来命名程序和函数。变量名要足够长,尽量短,有意义。如果其他程序员不能够理解你的代码,说明你写的不够清楚。在大多数情况下,针对下一个程序员而编码要比针对环境而编码重要的多。

  10. 把分析和编程分离开做。它们不是同类的事物,需要不同类型的劳力资源,需要在完全不同的时间和地点分开做。如果同时做它们,你一样都做不好。(我喜欢在一天的末尾做不涉及技术的分析,而在第二天早上进行编程。)

  11. 永远不要图省事走近道。永远不要把相同的代码部署两次。永远不要把一个变量命名成另一个变量名的一部分。也许你不明白这些规则,也许你要辩解。但如果你是遵守着这样做的,这些规则就会约束你正确的构造你的程序。图省事的做法是让那些低等级的程序员永远停留在低等级的原因。

  12. 学习如何测评程序性能。你会惊奇的发现从中能学到很多之外的知识。

  13. 学会区别对待问题细节和问题后果。问题细节不会导致太大的差别,而问题后果能导致世界灭亡。只关注后果。

  14. 密切关注你的用户/客户/管理人员。帮助他们认清楚他们的“what”,这比帮助他们明白他们的“how”要重要的多。

  15. 写一个框架,不论你是否打算用它。你将从中学到从其它途径中学不到的东西。

  16. 把你知道的东西教给他人——通过口口交流或通过写作。最终这将成为教育自己的机会。

  17. 永远要对你的客户/用户说“Yes”,即使在你不确定的情况下。90%的情况下,你会最终找到方法实现它。10%的机会,你将会去向他们道歉。这是重要的个人成长中付出的一点小代价。

  18. 寻找别人的做出神奇的事情但却一滩糊涂的代码。重构它。然后丢掉它,并发誓自己永远不要犯他们犯下的相同错误。(这样的程序你会发现很多。)

  19. 数据永远 > 理论或观点。通过开发东西来学习数据。

  20. 有可能的话,开创自己的业务(服务或产品)。你将从中学到很多你做雇员永远学不到的关于编程的知识。

[英文原文:How to be an Excellent Programmer for Many Years ]

来源: [http://www.aqee.net/how-to-be-an-excellent-programmer-for-many-years/](http://www.aqee.net/how-to-be-an-excellent-programmer-for-many-years/)

希望本站内容对您有点用处,有什么疑问或建议请在后面留言评论
转载请注明作者(RobinChia)和出处 It so life ,请勿用于任何商业用途