4 ms·
I think what the parent comment is saying (that I agree with) is that it's easy to over-estimate the cost and under-estimate the value. You don't _have_ to do a
by abstract_put 5y ago
I think what the parent comment is saying (that I agree with) is that it's easy to over-estimate the cost and under-estimate the value. You don't _have_ to do anything with types, but it's another tool to use where it makes sense. Or put another way, provided it's not mandatory what's the downside to having another tool in the toolbox?
- Mikeb85 5y agoThe downside is the ecosystem turning into the JS/TS ecosystem. Where the zealots have pushed TS to the point it all just looks like C# and what makes JS nice is being lost.
- abstract_put 5y agoDo you have any specific examples of things that make JS nice that have been lost because of the popularity of TS? As with types in Ruby, I was under the impression nothing was really lost as TS could be added incrementally as developers saw value. I don't think I've talked to anyone who has gotten "over the hump" with TS and felt like they were missing something from JS - I may be in a bubble though. It's almost frustratingly beloved in my experience.
- fiddlerwoaroof 5y agoI’ve been writing TS for a year now and I find TS annoying. Especially for react components with state management of some kind, the types get so complex you almost need unit tests to assert they are what you think they are. Additionally, TS being a structural type system with no access to nominal types at all eliminates a whole class of “ghosts of departed proofs” modeling techniques. (And, I know you can work around this, but those workarounds are ugly.) My view is that I’d use TS if I have to but I’d pick either plain JS / CLJS or something like purescript if I really wanted types.
- jamil7 5y agoI haven’t touched the ecosystem really for a number of years but my last JS project was in TS and I hated it for the same reason. The overhead of bringing in yet more npm modules and types and build steps for questionable levels type safety. Languages with much better type systems exist.
- canaus 5y agoSuch as?
- arcanon 5y agoThe year is 2021. People argue for a toolchain that takes a static language, compiles it to a dynamic one, then runs it with an interpreter on the server side. Humanity ended shortly thereafter.
- zerocount 5y agoThe dynamic nature of JavaScript is lost when using TypeScript. Although TypeScript can be added incrementally, in practice I've only seen it totally replace JavaScript. While I do believe more people prefer TypeScript over JavaScript, I think it's because those people never deep dived JavaScript or bothered to learn it enough to see how powerful it really is. There are also people that just prefer typed languages and will shun languages without static types. This really is a religious war and boils down to one's opinion. I like JavaScript without typing.
- joelbluminator 5y agoWhy the downvoting? You somehow upset the typed mob I guess...
- regularfry 5y agoOnce you have more than one team in the same codebase the opinions start to line up as people start to think the types will save them from stepping on each others' toes. Which it might! Publishing types is also a poor-man's contract testing, so people who like that sort of thing will like that sort of thing.
- eropple 5y agoI have implemented a JavaScript virtual machine. I feel confident in my knowledge of JavaScript as a language and as an operating environment. What power am I no longer able to leverage using TypeScript when it's appropriate to do so?
- fastball 5y ago1. What's wrong with C#? 2. What made JS uniquely nice? I wanted to leave these questions entirely open to answer, but I'll add my own opinion on (2) because I feel compelled: nothing, JS is quite possibly the worst language ever designed. Certainly the worst in widespread use.
- zarzavat 5y agoWhy is JS one of the worst languages ever designed? I've used many languages and JS is one of the better designed ones in my opinion.
- tonyedgecombe 5y ago>Why is JS one of the worst languages ever designed? Implicit type conversions. Function scoping. Null and undefined, what is the difference? Accessing an undefined variable doesn't throw an exception. Assigning to an undefined variable without var puts it in the global scope. No integer type. I could go on and on. The only reason it has become successful is because it has a monopoly in the browser.
- mypalmike 5y agoMy favorite recent discovery is calling a js function with too many or too few parameters. It'll just go ahead and do it.
- phyrex 5y agoThere’s an implicit “arguments” function argument through which you can access the extra parameters. It’s JSs way of function overloading
- tonyedgecombe 5y agoWhich looks like an array but isn't.