3 ms·
>"Bulldozer code" that gives the appearance of refactoring by breaking out chunks into subroutines, but that are impossible to reuse in another context (very hi
by benihana 12y ago
>"Bulldozer code" that gives the appearance of refactoring by breaking out chunks into subroutines, but that are impossible to reuse in another context (very high cohesion)
>3. Difficulty writing functions with low cohesion
Is there some definition of cohesion I don't know, or is the author confusing cohesion and coupling?
- kornish 12y agoFrom Wikipedia: "In computer programming, cohesion refers to the degree to which the elements of a module belong together.[1]", where [1] is Yourdon & Constantine 1979. It appears that author uses cohesion and coupling - and rightly so, by the above definition - as synonyms.
- Silhouette 12y agoCohesion and coupling certainly are not synonyms. Cohesion is about how much the code within a single module deals with the same or closely related concerns, so that behaviour "belongs together". High cohesion is usually considered desirable. Coupling is about how much multiple modules depend on each other. For example, do they communicate only via a clearly defined interface, or do they have implicit dependencies like sharing memory or resources? Loose (i.e., low) coupling is usually considered desirable.