3 ms·
Shit, TypeScript's the first time JavaScript's been not-terrible. If I squint and tilt my head it sometimes even looks almost good. I'm also a fan of "class" s
by yamtaddle 4y ago
Shit, TypeScript's the first time JavaScript's been not-terrible. If I squint and tilt my head it sometimes even looks almost good.
I'm also a fan of "class" since it makes the deeply-embedded-but-awful OO system actually usable without twisting into a pretzel or engaging in a whole lot of "OMG why, why did you do that?".
- somewhereoutth 4y agoI 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)