DEV Community

Discussion on: Classes Rock

Collapse
 
willsmart profile image
willsmart • Edited

I’ve got a useful regex substitution for situations like this...
s/\b(\w+) (rocks|sucks)\b/\1 is a tool that is useful for some things but not everything. It’s a power drill or tape measure, not a religion or sports team. Use \1, but avoid deriding or evangelizing it/

Works for pretty much anything to do with coding 🤓

As for classes, they’re a great way to ensure objects implement their advertised interfaces, which can keep things nice and clean code-wise if not overdone, and they have good implementations on most any modern language.
As you were saying, it works out better to think of them as “objects with the same behaviour” than “objects of the same intrinsic type” (whatever that means).

Thanks for the thought provoking post Dimitri!

Collapse
 
dmerejkowsky profile image
Dimitri Merejkowsky

Thanks for the thought provoking post Dimitri!

You're welcome. I love making people think :)