你如何理解大块代码? [英] How do you understand a large chunk of code?
问题描述
我是一个刚刚开始工作的新生大学毕业生。在我的加速期,我需要学习很多产品代码。有一些设计文档,但他们没有帮助太多。
I am a fresh college grad student that just started my job. In my ramp up period, I need to learn a lot of product code. There are some design docs but they do not help much.
您可以提供一些一般技术来浏览和了解大量产品代码(特别是C ++)吗?
Can you provide some general techniques to browse and understand huge product code (specifically C++)?
推荐答案
通过 doxygen 运行。这将生成html文档,这将有助于即使代码没有正确的doxygen风格的注释。
Run it through doxygen. This will generate html documentation which will be helpful even if the code does not have proper doxygen-style comments.
另一个很好的建议是通过单元测试,如果有是任何。如果没有单元测试,理解代码的好方法是编写自己的单元测试。这样做的努力将付出很多代价。
Another good advice is to look through the unit tests, if there are any. If there are no unit tests, a good way to understand the code is to write your own unit tests. The effort to do this will pay for itself many times over.
这篇关于你如何理解大块代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!