看<> 一周

最近从图书馆借了本《clean code》 , 这本书都是讲一些平时一个程序设计人员在设计编码方面如何合理的写出更友好的代码。但书中多次提到一个问题,就是理论与实际的对比。就是尽管书中写得如何的好, 我们从书中学识,了解到这些问题的存在, 但是我们仍然会去犯错。只有犯过错,我们才能真切体验它的重要性。

看看书中引用的话:

"Clean code can be read , and enhanced by a developer other than its original autohor I has unit and acceptance tests.It has meaningful names. It porvides one way rather than many ways for doing one thing. It has minimal dependencies, which are explicitly defined, and porvides a clear and minimal API.  code should b literate since depending on the language, not all necessary information can be expressed clearly in code alone."

 想起最近在查看的代码, 有些命名过于自由化, 有时翻查起来, 又要重新去查看函数的实现,还有就是各函数的依赖关系。有些函数的实现,既返回结果, 又设置值,比较不合理。

这些都是要自己亲自多写代码,才会发现更多,才越来越感觉Clean code 的重要性。

 

 

你可能感兴趣的:(code,clean)