代码整洁之道——童子军军规
美國(guó)童子軍一條簡(jiǎn)單的軍規(guī):讓營(yíng)地比你來(lái)時(shí)更干凈。
清理代碼也許只是改好一個(gè)變量名,拆分一個(gè)有點(diǎn)過長(zhǎng)的函數(shù),消除一點(diǎn)點(diǎn)重復(fù)代碼,清理一個(gè)嵌套if語(yǔ)句。
這是讓項(xiàng)目代碼隨著時(shí)間流逝而越變?cè)胶玫淖顚I(yè)的做法。
持續(xù)改進(jìn)也是專業(yè)性的內(nèi)在組成部分。
The boy scouts of America has a simple rule: make the camp cleaner than when you arrived.
Cleaning up the code might be as simple as changing a variable name, splitting a function that is a little too long, eliminating a little bit of duplicate code, and cleaning up a nested if statement.
This is the most professional way to make your project code better over time.
Continuous improvement is also an integral part of professionalism.
轉(zhuǎn)載于:https://www.cnblogs.com/stephen-java/p/10533926.html
總結(jié)
以上是生活随笔為你收集整理的代码整洁之道——童子军军规的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 反射就是获取该类的.class文件里面的
- 下一篇: 从源码来理解slf4j的绑定,以及log