时隔三年,这是第二次阅读《代码整洁之道》,并以第三者的角度来看代码质量的问题,感慨良多。最主要的是我们要去写具有表达力、张力的代码;在修改时,每次签出都要比来时更整洁,千里之行始于足下。
写代码,本质上写法与中学作文无异,写的过程和好故事都需要兼顾。实现了业务功能的代码只是作为一个开始,软件的生命周期决定了它后期还需要人来持续的维护,而不同的人代码风格迥异。整洁代码就如同一门语言,让不同国家的人通过它都能很好的欣赏到作品本身的美。它就像一件艺术品,乍一看你可能看不懂,但你深入进去就会深深感受到代码身后的魅力。
概览
![](https://i-blog.csdnimg.cn/blog_migrate/ef88754352fa70c809e23468d0bf23f1.png)
![整洁代码](https://i-blog.csdnimg.cn/blog_migrate/6dc5e2bf774232cbd1388c990e102bf2.png)
![](https://i-blog.csdnimg.cn/blog_migrate/8616b4f6e1504bdc2a20fa9d56246fdd.png)
![](https://i-blog.csdnimg.cn/blog_migrate/d07b41d2b6f0f6a78be1b50f4cb6909f.png)
![](https://i-blog.csdnimg.cn/blog_migrate/cb51ce5abd2fbca3a78535c15c5293e0.png)
![](https://i-blog.csdnimg.cn/blog_migrate/57aac6abf667c7e63a1b48774a1a192e.png)
![](https://i-blog.csdnimg.cn/blog_migrate/e410bc2b9553d1c3e28440be04553d66.png)
![](https://i-blog.csdnimg.cn/blog_migrate/bb723b6a47d1b1045c937f83d9f5dd5b.png)
![](https://i-blog.csdnimg.cn/blog_migrate/2113c8afb3a80cbd284b9d539eb6ff51.png)
![](https://i-blog.csdnimg.cn/blog_migrate/83ad8c3c0244598e64b7bf46a1b25973.png)
![](https://i-blog.csdnimg.cn/blog_migrate/fd3b853969d23b0b6fff793dae31ee29.png)
![](https://i-blog.csdnimg.cn/blog_migrate/8a4c709671bf6a04bd943c928269a659.png)
![](https://i-blog.csdnimg.cn/blog_migrate/be30bccc7d080429bfc9a63fd0c3b921.png)
![](https://i-blog.csdnimg.cn/blog_migrate/66c9b9257e5161b0514f30c01b093623.png)
![](https://i-blog.csdnimg.cn/blog_migrate/57202b19c5bd3f82131a936910a34be8.png)