4 ms·
I prefer to have data structures (records, arrays, primitives), then organise the functions operating over those structures into logically sensible places, inst
by somewhereoutth 4y ago
I prefer to have data structures (records, arrays, primitives), then organise the functions operating over those structures into logically sensible places, instead of tying them into the structures themselves via classes.
Occasionally it is necessary for structures to act polymorphically, thence it is but a simple matter to put a function in the structure for that behaviour (maybe with a reference to the enclosing structure in scope)