文章提到 anti-patterns 主要是代码设计中常见的问题

  • Copy and paste programming:Copying and modifying existing code without creating more generic solutions. 复制粘贴式编程,仅仅使用现有的代码,而不去设计一种通用的解决方案。

  • Hard coding:Embedding assumptions about the environment (such as constant numbers) in multiple parts of the software. 硬编码

     

  • Interface bloat:Having too many methods, or too many arguments in functions; in general, refers to a complicated interface that is hard to reuse or implement. 接口膨胀:方法太多/参数太多,难以重用和实现。

     

  • Reinventing the (square) wheel:Implementing some code when something (better) already exists in the available APIs. 重造轮子(这里指的是现成的更好的解决方案,需要与复制粘贴式编程区分开)

     

  • God Object:An object that has too much information or too much responsibility. This can be the result of having too many functions in a single class. It can arise from many situations, but often happens when code for a model and view are combined in the same class. 超级类:一个类的职责太多和信息量太大