Daily Productive Sharing 475 - How to Write Better Code?

Daily Productive Sharing 475 - How to Write Better Code?
Photo by Joan Gamell / Unsplash

One helpful tip per day:)



Alex Ewerlöf, a software engineer with 20 years of experience, has summarized twenty programming insights. The following have been very helpful to me.

  1. write code not for machines to read, but for your future self and for your collaborators to read.
  2. deprecate yourself from the code and be prepared to speak about it when you're done, rather than owning it all the time.
  3. copy and paste code is easy to copy bugs, learn to reuse code, not copy and paste.
  4. keep learning, if you think you're already a master, it means you're not learning enough.
  5. write more pure functions and more tests.
  6. understand the problem before writing code, understand the business before writing code.

If you enjoy today's sharing, why not subscribe?

Need a superb CV, please try our CV Consultation

Alex Ewerlöf 是一位有着20年经验的软件工程师,他总结了二十条编程感悟。以下这些对我帮助非常大:

  1. 写代码不是写给机器读的,而是写给你未来的自己,写给你的合作者读的;
  2. 将自己从代码里剥离,写完就要准备讲这些代码托付给其他人,而不是一直拥有这些代码;
  3. 复制粘贴代码很容易复制 bug,要学会复用代码,而不是复制粘贴;
  4. 保持学习,如果你觉得自己已经是大师了,那说明你学习得不够;
  5. 多写纯函数,多写测试;
  6. 理解问题之后再写代码,理解业务之后再写代码。

如果我们的内容对你有价值,不如付费支持我们 :)

需要更棒的简历,不妨试试我们的 CV Consultation

如果你也想成为更高效的人,欢迎加入我们的 TG group