4 ms·
Yes! I was waiting for this so long, Typescript is the most flexible typed OOP language and it's way more than just a JS successor.
by craftoman 7y ago
Yes! I was waiting for this so long, Typescript is the most flexible typed OOP language and it's way more than just a JS successor.
- hutzlibu 7y agoOnly that this subset has no objects and is therefore not a OOP language anymore (?)
- tantalor 7y agoIt does have objects: STS has at runtime four kinds of unrelated object types: 1. a dynamic map type has named (string-indexed) properties that can hold values of any type; 2. a function (closure) type; 3. a class type describes instances of a class, which are treated nominally, via an efficient runtime subtype check on each field/method access, as described below; 4. an array (collection) type.
- hutzlibu 7y agoOk, I did not read the specifications yet and just refered to the other comment. But your quote gives no indication of (prototyp or classical) inheritance?
- tantalor 7y agoSTS classes are compiled similarly to Java or C# with single inheritance and static memory layout. Don't know much about STS or TS but I assume the usual JS class syntax works as spelled out here: https://www.typescriptlang.org/docs/handbook/classes.html https://www.typescriptlang.org/docs/handbook/classes.html