-
Notifications
You must be signed in to change notification settings - Fork 0
Stupid or Solid?
These are the habits we formed the first time we learned to code. As far as I remember, every project used a singleton pattern, we tested by running our bug riddled code as a whole, with variables with names such as "potato" or simply "a". What even were loops or functions for the better part of the semester?
Cohesion is the name of the game. It is better to have a class responsible for a small part of the program than to be a jack of all trades that lends itself to more problems. Changes to code should be additions, not modifications. This is helped by interfaces. Subclasses of a class should be substitutable for their parent. The interface should be as specific as possible. There should not be an one interface does all situation going on. And keep the dependency of high level code low.
Source: William Durand