loading...

re: OOP Overkill VIEW POST

FULL DISCUSSION
 

"I've never ever felt the need to take this approach"

That makes sense, because that need doesn't drop out of the sky while you are busy typing functional or procedural code. You're already comfortable and effective with a technique, so why change it?

You'll first have to spend some time stepping out of your comfort zone, learning how OOP works and how you can use OOP patterns to build something. It will take more time to achieve the same stuff at first, but sooner or later you'll have a few "a-haaaaa" moments.

OOP is not just about classes, but also about achieving a common way to structure code, making it easier to work in a team or work on someone else's code.

Have you looked at the MDN documentation for the DOM?. I think this perfectly illustrates a good use case for OOP inheritance.

MouseEvent is an Event that has some extra properties that only apply to events triggered by using the Mouse.

HTMLCanvasElement is an HTMLElement that has extra properties that only count for canvas elements.

Code of Conduct Report abuse