倾听你的代码。
Most importantly, document your code.
最重要的是,一定要为代码编写文档。
Refactor your code and automate your tests.
重构代码并自动化测试。
This makes your code a lot easier to maintain.
这使代码维护的难度大大降低。
This is by far the easiest way to debug your code.
这是目前为止最简便的代码调试方法。
Properly indent your code to make it more readable.
在代码中适当地进行缩进,增加代码的可读性。
Handling errors properly makes your code more robust.
适当地处理错误会使代码更加健壮。
Think of your code as something you present to the world.
想象一下将代码展现给全世界。
It makes your code safer, less bug prone, and easier to read.
这将使您的代码更加安全、更不易出现bug,也更易于阅读。
It's good practice to add comments like this in your code.
在代码中添加类似的注释是个好习惯。
Refactoring will help you win back the command over your code.
重构可以帮助你赢回对代码的支配权。
Develop a habit of formatting your code comments consistently.
找到一种属于自己的注释格式。
You can even access and edit your code directly from a Web browser.
甚至可以直接从Web浏览器访问和编辑自己的代码。
Ensure that your code is documented, simple, and easy to comprehend.
确保您的代码是备有文档的、简单的并且易于理解的。
If you were an engineer, all that mattered was the quality of your code.
如果你是工程师,那么最重要的就是你写的代码的质量。
It is a great way to test and debug your code directly on the server.
它是直接在服务器上测试和调试代码的一种最佳方式。
Remember, this is a good thing — it means your code is becoming more flexible!
记住,这是件好事情——它意味着你的代码变得更加灵活!
This may not seem like a huge deal, but it certainly simplifies your code.
这看起来不是什么大事,但确实能够简化代码。
In it, I'll discuss how to discover design already lurking in your code base.
我将讨论如何发现代码库中隐藏的设计。
This way, you have a nice separation between your code and the generated binaries.
这样可以很好地把代码与生成的二进制文件分开。
Last month, I showed you how to use code metrics to evaluate the quality of your code.
上一期文章中,我展示了如何使用代码度量来评估代码质量。
However, it's important to understand how these solutions can be used in your code.
不过,理解如何在代码中应用它们才是最重要的。
When your code is getting both better and simpler, that is when you know it's right.
当代码变得高效又简洁的时候,就可以说是走上正轨了。
With this technique, you can support new data types without changing your code at all.
通过这种技巧,您可以支持新的数据类型,而不用更改任何代码。
It also gives your code repository a good, solid, and logical structure to build upon.
这还可以为代码存储库提供一个良好、稳定且符合逻辑的结构。
Running the tests early and often gives you absolute confidence in your code all the time.
尽早运行测试通常使您在任何时候都对代码充满信心。
I'm sure you have been told a number of times that you should write comments in your code.
毫无疑问,你已经千百次地被告知,在编写代码时一定要添加注释。
On the personal front, review your code and always ask, "How could I have done it better?"
对个人来说,经常检查你的代码并且自问,“我怎样才能写得更好呢?”
On the personal front, review your code and always ask, "How could I have done it better?"
对个人来说,经常检查你的代码并且自问,“我怎样才能写得更好呢?”
应用推荐