3 ms·
"A class is a pretty bad abstraction to try to fit the world into" I totally disagree with this. They are basically one of the best forms, if not 'the best' fo
by edblarney 10y ago
"A class is a pretty bad abstraction to try to fit the world into"
I totally disagree with this. They are basically one of the best forms, if not 'the best' form of abstraction we have, particularly when it comes closer to the level of 'real world' abstraction.
Classes are the basis of 'typing' - which is to say, typing beyond primitive types.
They provide us with the ability to 'define things' that are not simply strings, numbers or booleans.
It's why JS has moved onto classes, and almost all popular languages use them.
The only time I find they can be limiting, is when there is the necessity to deal with looser typing, i.e. quick litoral objects ... but even then, 9 times out of 10 when I want to 'get around classes' - I'm just being lazy.