4 ms·
For awhile I did not really know how to take this whole thing. Upon reflecting, I realise I probably do lean away from Classes in general... it was strange to c
by darylteo 15y ago
For awhile I did not really know how to take this whole thing. Upon reflecting, I realise I probably do lean away from Classes in general... it was strange to come upon that realisation, as I come from a strong Java/OOP background.
The benefits of Classes are still related to data abstraction. But it is pointless if you are still accessing the data directly anyway (getters and setters be damned). So, I would only legitimately prescribe a class only when you are building a data structure.
Nowadays, my classes are either
- composition of primitive data (as I don't have tuples(python)/structs or dynamic objects (javascript))
- or function groups (like a business logic layer of some sort, which could have just as easily have been just bags of functions in modules).
I'm going to be teaching my students Classes in a couple of weeks... food for thought before then.