![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
重构
此心光明-超然
这个作者很懒,什么都没留下…
展开
-
重构 改善既有代码的设计 第二版 - A First Example
重构 新版 - A First ExampleTHE STARTING POINTDECOMPOSING THE STATEMENT FUNCTIONRemoving the play VariableExtracting Volume CreditsRemoving the format VariableRemoving Total Volume CreditsSTATUS: LOTS OF N...原创 2019-02-27 15:20:17 · 3361 阅读 · 0 评论 -
重构 改善既有代码的设计 第二版 - Bad Smells in Code
重构 改善既有代码的设计 第二版 - Bad Smells in Code神秘的名字Change Function DeclarationRename VariableRename Field重复的代码Extract Function代码类似但是不完全相同时Slide Statements如果重复代码位于公共父类的子类中Pull Up Method长函数Extr...原创 2019-03-04 17:09:33 · 5670 阅读 · 0 评论 -
重构 改善既有代码的设计 第二版 - Building Tests
THE VALUE OF SELF-TESTING CODE程序员的大部分时间用于调试工作。Classes should contain their own tests.每工作一点就测试,才容易找到bug。当然,意味着要编写很多额外的代码。当需要增加一个功能的时候,我从编写测试开始。通过编写测试,我问自己需要做些什么。编写测试代码,也让我专注于接口而不是实现。我也有了一个明确的点-当...原创 2019-04-03 14:41:12 · 2502 阅读 · 0 评论