What is the name of this bad practice / anti-pattern?

前端 未结 14 2086
独厮守ぢ
独厮守ぢ 2021-02-03 18:02

I\'m trying to explain to my team why this is bad practice, and am looking for an anti-pattern reference to help in my explanation. This is a very large enterprise app, so here

相关标签:
14条回答
  • 2021-02-03 18:48

    I think the anti-pattern name is hard-coding :)

    Whether there should be a ThingBase.supportsX depends at least somewhat on what X is. In rare cases that knowledge might be in ControlStuff() only.

    More usually though, X might be one of set of things in which case ThingBase might need to expose its capabilities using ThingBase.supports(ThingBaseProperty) or some such.

    0 讨论(0)
  • 2021-02-03 18:48

    If it were one string, I might call it a "magic string". In this case, I would consider "magic string array".

    0 讨论(0)
提交回复
热议问题