STUPID Principles

Software design improves whe you avoid doing the wrong thing.

What are the STUPID Principles?

Poor Object Oriented design is achieved when people follow the S.T.U.P.I.D. principles of software design:

(S)tuff that is Global

For example, global variables, static methods, and singletons.
The problems here include:

  • Uncontrolled access to global entities
  • Tight coupling throughout the code base
  • Broken encapsulation
  • Extension is often hard
  • Changes can effect everything

(T)ight Coupling

In other words, high levels of interdependency between modules. Tight coupling is often caused by dependency on specifics of an implementation.

(U)nclear Naming

Often a symptom of not knowing what a module is actually for.

(P)remature Optimization

Sacrificing code clarity (not to say developer time) to making things faster… even if nobody cares if they’re slow.

(I)nvisible Dependencies

When, for example, using a class means that you have to take a whole lot of other classes along for the ride… even if you don’t actually need them.

(D)uplication and Redundancy

For example:

  • Over-generalization (I think eveyone does this)
  • Commented-out code
  • Repetition and duplication and other types of repetition
  • Functionality that the user doesn’t value

 

Leave a Reply

Your email address will not be published. Required fields are marked *