The Clean Coder 是The Clean Code的姊妹篇,由同一个作者编写,The Clean Code主要讲述如何编写高质量的代码,而The Clean Coder则关于于人,讲述如何做一个”专业“的编码人员。
以下是我看完此书的一些笔记,做个小记。
- 持续重构:无论什么时候看到坏味道的代码,重构它,不要以”怕影响线上功能“为理由,如果想保证代码的高质量,只有不断的,无情的重构。同时,为了能保证重构前后代码的等效性,完备的测试代码是必不可少的。
- 练习编码:就像运动员需要训练、棋手需要对弈一样,程序员需要不断练习。这里的练习不是找尚未解决的问题,而是重复地练习固定的题目,只求越来越熟悉,直到训练出编写固定题目再无任何冗余动作的地步。它旨在练习手指和思路,还有工具的熟练程度。TDD、算法、固定起手式,都可以练习。并且练习可以结对进行,比如一人写测试用例,一人写实现,二者交换角色。这有助于练习结对编程。
- 对于工时预估:不可能准确的,但是专业的编码人员能识别延期的风险,最大限度告诉外界,给外界正确的预期。所以,我们要:
- 大胆说不,完成不了的时候,强硬的说完不成,只能做到预期功能的几分之几
- 要求告知工时的时候,区分 ”承诺“和”预估“ 能完成的时间,承诺必须遵守,而预估是一个可以不断修正的模糊值。
- 讲工时拆分,拆开为乐观估计、一般估计、悲观估计,三者综合考虑,或者仅仅考虑一般估计和悲观估计的加权平均(4:1)
- 如果发现进度落后&#