JavaScript coders doomed to ignorance?

Personally, as a guy preferring ES7 over TS for private projects, I think the problem for many people is the lack of intelligent type support. By intelligent I mean trivial stuff that the compiler can do better in the compiled-down JS. And yes, I never write JS "standard" style because the inventors did not understand the word "maintainabilty" if the coding style forces the debugger in all VMs to produce useless stack traces and errors.

For me the question is: Why have the overhead of TS if the TS compiler can not make a simple ternary in the first line of each function for each optional argument? Stuff like this bothers me enough to use Babel with ES7, but just for the sake of async / await. It's a different thing for me with TS.

I really understand the benefits of TS in team-based work. If you have multiple teams working on the same codebase, TS is superior because you don't have to have the files open all the time to use an API. I'm used to using TS at work a couple years, I like their approach but I don't like how they do it with a forced superset for benefits. They could do everything much more intelligently with suggestions and automation. But that's a different story.

The problem for most JS people is the overly complicated syntax that they don't understand on first sight (with most guys having zero experience in C/C++).

Remember: JS is a language focussing on getting things done quickly, no matter the trade-off. Write once, never maintain.

TS is the complete opposite, coming from and made for C++ devs. Maintenance and (arithmetic) quality is their focus. But you have to admit that you cannot use generators and "bind(expression)" in a meaningful productive syntax inside TS because the compiler will annoy you with bad syntax messages. That's why I said it's for C++ devs, not for LISP and Haskell guys that think differently. If you choose TS, you enforce them to think differently and I think that's a bad thing for a code superset that is a logical subset. :)

Both JS and TS are made for a completely different group of people. Personally, coming from the C++ world and using both languages nowadays for big AI projects, I can fully recommend learning LISP and Haskell. It will blow your mind and you will think differently about TS vs. JS discussion once you figured out the strength of S-Expressions and List Comprehensions.

/r/typescript Thread