3 ms·
What turns me off immediately about TypeScript (and examples in the article show it) is the use of the class construct. If I could see some examples of teams wr
by arcosdev 9y ago
What turns me off immediately about TypeScript (and examples in the article show it) is the use of the class construct. If I could see some examples of teams writing TypeScript without falling into the use of classes I would feel a lot better about it. I am in full agreement with Douglas Crockford and others that adding pseudo-classes to JS was a big mistake.
- pimterry 9y ago> I am in full agreement with Douglas Crockford and others that adding pseudo-classes to JS was a big mistake. Why? It's certainly not a requirement of TS, any more than it is in JS, and I've seen people writing large TS codebases without classes. Typically with a much more functional approach though. I don't see people writing many prototypical objects with TS. Is there a good reason they should be?
- zebrafish 9y agoI'm curious as to why you don't like the use of classes. Are you against classes in all languages or just JavaScript?
- sotojuan 9y agoA lot of people are into the "functional JS!!1!!1!!" hype and blindly dislike anything related to OOP with little information. Also, TS does not force you into OOP. TS codebase itself does not have any classes.
- arcosdev 9y agoI'm not against classes in other languages, especially those that follow a typical OOP pattern (i.e. Java, C#, etc.). See above for my reason re: JavaScript.
- valuearb 9y agoSo appeal to authority?
- egeozcan 9y agoI partially agree. Something to consider: Like the callbacks, prototypes are very flexible, so this flexibility comes at the cost of interoperability. When you have a standard way to declare classes, methods and meta data for them, this information is easier to consume from other libraries.
- RyanCavanaugh 9y agoYou could look at the TypeScript compiler itself, which uses zero classes.