I love designing classes in an Object Oriented fashion.
It gives a good feeling, like there aren’t just a bunch of empty method.
Each method belongs to something larger, each piece makes the whole complete.
Object Oriented Programming (OOP) just makes sense to me.
I like to think of classes as factories.
Each factory pumps out a special part thats essential for the whole.
The combination of all of the parts produced by the factories make a larger
object.
Attacking problems this way helps me pre-debug(defensive coding) the situation.
Doing so makes it easier to debug, read, and understand.
Even when not specifically designing Object Oriented features, I still
think of designing projects like objects.
Let’s say I’m building a rails app.
At the top level there is the MVC(model, view, controller).
From there I break it down into pieces.
Each view has several HTML & CSS files.
Each HTML can have partials, their own css stylings, etc.
I keep breaking every piece down and down to make every little bit easier to
understand.
To me, designing this way helps maintain my sanity and keep organized.
Objects are my friends, and designing in such a way isn’t too hard of a task. Just be mindful of the roles each object plays, name them accordingly, and create the puzzle that holds all the pieces perfectly.