2020年/03月/04日

首页回退

可爱的特性

原文

I produced a lot of code. A lot. I tried very hard to make all that code nice. Several times I was doing some cute features. Parts of the code which are not needed for the required result, but feels right. Or cool. Many times in those cases I regretted that after.

我写了很多代码。很多。我非常努力地让所有的代码都变得漂亮。但有时,我会写出一些可爱的功能。它们是需求中不需要的代码,但感觉是正确的,或比较酷的。每次干完这种事情,最后的结果都是后悔。

The cute feature could be:

这些可爱的特性可能是:

Organize small bits (instead of keeping them in one file until it gets bigger to see which structure makes more sense)

Layers of abstraction (instead of tight it together until there is a need for the abstraction)

Future functions (instead of waiting for the time functionality is really needed)

把代码分块到很多小文件里(而不是让它们放在一个文件里,直到它的体积增长到理解这个架构变得困难时才拆分)

多层抽象(而不是紧凑的放置代码,直到需要抽象时才抽象)

未来的功能(而不是等到这个功能真正需要的时候才去实现)

Today isn’t New Year, but I’m taking resolution regardless:

今天不是年终,但我还是要做一些总结:

I will not do any cute feature again!
坚决不写可爱的功能!

Only constant is that requirements mutate. I will try harder to keep the code easy to change, not overengineer stuff, and not trying to make it nice as much as possible.

I recommend you the same but I understand you need to come to this point alone.

唯一不变的东西是需求会变化。我将更努力地保持代码易于修改,而不是过多的追求技术上的设计,而不是一门心思的想让代码实现完美。

我建议你也这么做,但我明白你需要亲自体验这些事情