3 ms·
Using 'classes' doesn't imply OO. They're a perfectly good way to organize data, at very least for data objects in TS. It's fine to want to go functionally hea
by jollybean 6y ago
Using 'classes' doesn't imply OO. They're a perfectly good way to organize data, at very least for data objects in TS.
It's fine to want to go functionally heavy, but if you're not using classes - which are the foundation of 'types' - then why bother with 'type'script? (Unless you mean to say 'interface'? Which is obviously not 'class' but implies the same usage of OO-founded keywords)
- Kinrany 6y agoIn TypeScript classes are in no way foundational. At the type level they are roughly implemented as a combination of two types: the instance type and the "newable" constructor function type.
- desert_boi 6y agoTypescript works perfectly well without classes, even better sometimes (see decorators and Typescript). The shape of data is more foundational than classes. An object without a class is a perfectly good way to organize data too, based on its shape.