Reading/Understanding third-party code

2020-06-25 19:07发布

When you get a third-party library (c, c++), open-source (LGPL say), that does not have good documentation, what is the best way to go about understanding it to be able to integrate into your application?

The library usually has some example programs and I end up walking through the code using gdb. Any other suggestions/best-practicies?

For an example, I just picked one from sourceforge.net, but it's just a broad engineering/programming question: http://sourceforge.net/projects/aftp/

标签: c++
7条回答
太酷不给撩
2楼-- · 2020-06-25 19:49

One of the better ways to understand it is to attempt to document it yourself. By going and trying to document it yourself, it forces you to really dive in and test and test and test and make sure you know what each statement is doing at what times. Then you can really start to understand what the previous developer may have been thinking (or not thinking for that matter).

查看更多
登录 后发表回答