4 ms·
What's wrong with TypeScript?
by hasenj 9y ago
What's wrong with TypeScript?
- alkonaut 9y agoI haven't used it enough to have a detailed opinion but from what I can see it looks like an excellent language.
- weberc2 9y agoI'm having a hard time discerning his point based on the languages he listed. I think his point was that the type theorists weren't fans of JS so they built languages that compiled to it, but CoffeeScript and ES6 don't have type systems either, so either he isn't very familiar with the languages he listed or he's making a different point.
- alkonaut 9y ago> CoffeeScript and ES6 don't have type systems either All languages have type systems. Including ES5, ES6 and CoffeeScript. They might be weak and dynamic but they are type systems none the less. > I think his point was that the type theorists weren't fans of JS I'm fairly sure that's the case (no data though) > or he's making a different point. My point was (a bit toungue in cheek) that seeing how many alternatives that keep popping up for avoiding JS (the language), it seems that a lot of people who like programming languages to the point where they can create one, do not like JS.
- sillysaurus3 9y agoHi. I'm interested in type theory, and I'm a big fan of JS. shrug Is it really so hard to believe? Imagine if the browser's scripting language didn't have closures or prototypical inheritance. It was possible. JS was a pretty good compromise between power and simplicity.
- alkonaut 9y ago> Hi. I'm interested in type theory, and I'm a big fan of JS. fan of JS as a whole package (Language, ecosystem, ...) or JS only as a language? The whole package is very attractive, and I can see how people accept ES5 (the language) for the opportunity to work with JS the ecosystem. JS the language I think has some cool features and with ES6 it's even an acceptable language to work with, but I just fail to come to terms with some of the smaller warts. The feeling I'm looking for in a language is "this is carefully designed to be consistent, simple and free of idiosyncraces and suprises". With equality, scoping, coercions etc in ES5 that realy is NOT the feeling. ES6 is so much better, but once you pick an ES5 alternative there are so many other choices. > JS was a pretty good compromise between power and simplicity. I really don't get why people think JS is "simple" though. It's fantastically complicated. Mostly accidentally though., because of the little warts in scoping/equality/coercion etc. Again, ES6 is a lot better - but still very very not simple compared to e.g. Java.
- sillysaurus3 9y agoImagine a program to implement JS vs Java. Which would be shorter? That's why it seems fair to say that JS is much simpler than Java.
- gizmo385 9y agoI don't think that's a particularly good way to judge the problem though. Sure, the JavaScript example might be shorter, but which implementation is safer? Which is going to be easier to work with in the future? I'd make the assertion that the JavaScript version will have a lot more edge cases that could have been caught sooner with a more robust type system.
- fasquoika 9y agoAt the very least, the size of the standards of the two are comparable. JS is far too inconsistent to be truly simple https://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf https://www.ecma-international.org/publications/files/ECMA-S... https://docs.oracle.com/javase/specs/jls/se9/jls9.pdf https://docs.oracle.com/javase/specs/jls/se9/jls9.pdf
- weberc2 9y ago> All languages have type systems. Including ES5, ES6 and CoffeeScript. They might be weak and dynamic but they are type systems none the less. I understand; I was speaking colloquially. No need to be pedantic. > My point was (a bit toungue in cheek) that seeing how many alternatives that keep popping up for avoiding JS (the language), it seems that a lot of people who like programming languages to the point where they can create one, do not like JS. Your original post focused on type systems specifically. It seemed something like "type theorists dislike JS, as evidenced by <languages>". This is different than "programmers generally dislike JS, as evidenced by <languages>"; however, to focus on your latter claim, I don't think your claim follows the evidence--the most we can say is that many programmers dislike JS; however, I don't think this is a particularly useful observation, since every domain has many candidate languages, and relatively few domains are trending toward consensus. It seems like the most meaningful conclusion is "programmers have diverse tastes, projects have diverse priorities, and many of those tastes/priorities are mutually exclusive (there are no languages that are good for learning curve and maximizing performance, for example). This conclusion is not necessarily surprising, but I think it's the most interesting claim we can derive from the stated evidence.