What techniques do you use to maximise code reuse?

后端 未结 7 1605
别那么骄傲
别那么骄傲 2021-01-04 02:36

Some years ago I was told about a study into code reuse. Apparently it was found that, on average, programmers have a 7 minute window when searching for code to reuse. If th

7条回答
  •  遥遥无期
    2021-01-04 02:58

    • Have a framework that is actively supported.

    • Know the existing code base / make the other developers know the code base. If your group/company is large enough, have somebody who knows the code base and can be asked for guidance.

    • Document, document, document. Undocumented code is useless for re-use because it takes way too long to understand its inner workings.

    • Have good interfaces. Easy types, easy structures or classes. The more complicated something is, the less it will be used in another project.

    • Optimize and debug reusable code. Developers who experience bugs in other people's code for the n-th time will begin to code already existing code anew.

提交回复
热议问题