Specifically, do you worry that Microsoft is going to eventually do the Microsoft thing and horribly fuck it up for everyone? I've really grown to appreciate the language itself, but I'm wary of it getting too ingrained at work only to have the rug pulled out from under us when it's become hard to back out.
Edit: not really "pulling the rug", but, you know, doing the Microsoft classic.
If I take my json and add a .yaml extension it works. If I take my c code and add a .cpp it works. If I take my js code and add a
.ts
... it doesn't workTS branches off of the JS syntax (which is great! way better than a syntax rewrite), but TS is not a superset; it does not meet the practical or technical definition of a language superset.
What are the additional requirements? Afaik valid JS is valid TS.
Type annotations. It can be as simple a adding
any
in front of parameters, but there are other edgecases too, and when you have a really big codebase it can be a pain to convert.Your own example fails because "class" is a valid variable name in c but not cpp.
I didn't say C++ was a superset of C, I said "if I take my c code and add a cpp extension it works". Believe me, I am painfully aware of the not-a-superset problem between C and C++. My point is Typescript doesn't even meet the very loose "its practically a superset" relationship that C++ has with C.
and I pointed out that it doesn't if your C code has a variable called "class".
Don't worry, none of my code uses that, designated initilizers, complex numbers, variable length arrays, typedef name overloading, unintilized constants, implicit void pointer casting, implicit function declarations, nested struct defintions, or any of the other exclusively-C features.