Managing highly repetitive code and documentation in Java

后端 未结 9 670
南旧
南旧 2020-11-30 22:53

Highly repetitive code is generally a bad thing, and there are design patterns that can help minimize this. However, sometimes it\'s simply inevitable due to the constraints

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-30 23:35

    If you absolutely must duplicate code, follow the great examples you've given and group all of that code in one place where it's easy to find and fix when you have to make a change. Document the duplication and, more importantly, the reason for the duplication so that everyone who comes after you is aware of both.

提交回复
热议问题