The best way to familiarize yourself with an inherited codebase

后端 未结 14 1464
[愿得一人]
[愿得一人] 2021-01-30 02:54

Stacker Nobody asked about the most shocking thing new programmers find as they enter the field.

Very high on the list, is the impact of inheriting a codebase with which

14条回答
  •  北荒
    北荒 (楼主)
    2021-01-30 03:05

    I don't know about this being "the best way", but something I did at a recent job was to write a code spider/parser (in Ruby) that went through and built a call tree (and a reverse call tree) which I could later query. This was slightly non-trivial because we had PHP which called Perl which called SQL functions/procedures. Any other code-crawling tools would help in a similar fashion (i.e. javadoc, rdoc, perldoc, Doxygen etc.).

    Reading any unit tests or specs can be quite enlightening.

    Documenting things helps (either for yourself, or for other teammates, current and future). Read any existing documentation.

    Of course, don't underestimate the power of simply asking a fellow teammate (or your boss!) questions. Early on, I asked as often as necessary "do we have a function/script/foo that does X?"

提交回复
热议问题