in reply to Programming patterns

Wow.   I’m running out of up-votes.

I think that every method should “do something or die trying.”   Likewise, a property should “return a value or die trying.”   It should be entirely self-contained, knowledgeable of what it is doing and therefore of under what circumstances it does [not] make sense to do it, so that no one else is expected to (because no one else would know anyway).   Functional dependencies can lurk in lots of places, and if callers are (or, worse yet, have to be) making decisions and/or are “experts” in how to call you “correctly,” you have put cart before horse.

Like BrowserUK, I find that elaborate, supposedly “reusable,” class structures are rarely actually re-used between applications.   (That, after all, creates a dependency between applications!)

Inappropriate use of inheritance ... i.e. where the problem domain itself does not naturally use it ... also creates functional and implementation dependencies between the various classes.   Suddenly, you can’t change one thing without changing another.   Suddenly, changing one thing does change another ... whether you (heh...) knew it or not.   Code needs to be designed for long-term maintainability over the course of years.