What is an anti-pattern?

前端 未结 14 1117
日久生厌
日久生厌 2020-12-04 04:52

I am studying patterns and anti-patterns. I have a clear idea about patterns, but I don\'t get anti-patterns. Definitions from the web and Wikipedia confuse me a lot.

<
相关标签:
14条回答
  • 2020-12-04 05:29

    If you really wish to study AntiPatterns, get the book AntiPatterns (ISBN-13: 978-0471197133).

    In it, they define "An AntiPattern is a literary form that describes a commonly occurring solution to a problem that generates decidedly negative consequences."

    So, if it's a bad programming practice but not a common one—limited to one application, one company or one programmer, it does not meet the "Pattern" part of the AntiPattern definition.

    0 讨论(0)
  • 2020-12-04 05:29

    Any design pattern that is doing more harm than good to the given software development environment would be considered as anti-pattern.

    Some anti-pattern are obvious but some are not. For example Singleton, even though many consider it good old design pattern but there are others who don't.

    You can check question What is so bad about singletons? to better understand the different opinions on it.

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