3 ms·
TypeScript is quite a different beast than c# (structural typing, union/intersection types, control flow analysis, emphasis on types manipulation (Partial, Reco
by tejinderss 5y ago
TypeScript is quite a different beast than c# (structural typing, union/intersection types, control flow analysis, emphasis on types manipulation (Partial, Record etc). Even the TypeScript compiler is not following OOP patterns (it's all functions with union types as polymorphism).
- ameliaquining 5y agoThe TypeScript compiler is weird in a lot of ways. Like, all type checking happens in a single 40,000-line file. And it uses namespaces, which are officially soft-deprecated, instead of modules. Point is, I wouldn't look to it as an example of how to write a good TypeScript app. (Also, use of mostly functions with relatively few classes is common in, e.g., modern React; I don't think you're fighting the language too much if you do it.)