Essential complexity: Difference between revisions

Content deleted Content added
Cyclomatic complexity: this is not dubious, but notion of reduction used here need to be explained; it's not the same as the one used by B-J
for starters, these are clearly not indended to be the same notion.
Line 1:
{{split}}
'''Essential complexity''' refers to a situation where all reasonable solutions to a problem must be complicated (and possibly confusing) because the "simple" solutions would not adequately solve the problem. It stands in contrast to [[accidental complexity]], which arises purely from mismatches in the particular choice of tools and methods applied in the solution.
'''Essential complexity''' has been defined in various ways by various people. One definition is as an antonym to [[accidental complexity]]. Another definition is a number attempting to measure how close (or far) a given program is from being a [[structured programming|structured program]].
 
== CyclomaticAntonym to accidental complexity ==
'''Essential complexity''' refers to a situation where all reasonable solutions to a problem must be complicated (and possibly confusing) because the "simple" solutions would not adequately solve the problem. {{cn}} It stands in contrast to [[accidental complexity]], which arises purely from mismatches in the particular choice of tools and methods applied in the solution.
 
This term has been used since, at least, the mid-1980s. [[Turing Award]] winner [[Fred Brooks]] has used this term and its antonym of [[accidental complexity]] since the mid-1980s. He has also updated his views in 1995 for an anniversary edition of ''Mythical Man-Month,'' chapter 17 "'[[No Silver Bullet]]' Refired".<ref name="Brooks, Proc. IFIP" >[[#Brooks, Proc. IFIP|Brooks, Proc. IFIP]]</ref><ref>Brooks, IEEE Computer</ref><ref>Brooks, Mythical Man-Month, Silver Bullet Refired</ref>
Line 8 ⟶ 12:
year=1996}}</ref>
 
== Measure of a closeness to being a structured program ==
 
== Cyclomatic complexity ==
{{main|Cyclomatic complexity}}
 
'''Essential complexity''' is also used with a different meaning in connection with [[cyclomatic complexity]]. In this context, essential complexity refers to the cyclomatic complexity after iteratively replacing all well structured control structures with a single statement. Structures such as if-then-else and while loops are considered well structured and then do not increase the essential cyclomatic complexity. Unconstrained use of goto, break and continue statements can produce programs which can not be reduced in this way.