4 ms·
Have you looked into TypeScript? Type system helps you catch even more errors.
by DCoder 11y ago
Have you looked into TypeScript? Type system helps you catch even more errors.
- seivan 11y agoSecond this. There is no reason not to use TypeScript now that's easier to work with .jsx and add 3:rd party libraries without dealing with type definitions. Also, make sure to try out atom-typescript by Basarat. It's genuinely amazing and feels like Swift. :)
- egeozcan 11y agoAnother supporter here. I was very reluctant at the beginning but after seeing how it helped catch bugs earlier, I can't go back. I actually think that TypeScript makes JS more flexible because of the patterns it enables. I enjoy it even more than C#.
- Keats 11y agoAnother vote, catches so many errors and if decide to refactor you can pretty much just follow the compiler errors till it compiles.
- k__ 11y agoWhy not purescript or elm? I have the feeling that those Haskell like type-systems are superior to this whole Java/C# stuff.
- Keats 11y agoWell those 2 are entirely new languages, not just javascript with types added so they are not the same thing. Not everyone knows or want to learn Haskell
- Matthias247 11y agoI would guess that compatibility with existing JS libs is far easier with Typescript. You can trivially consume an existing JS lib from TS or export/compile your TS lib to pure JS, which other JS then can seamlessly consume. Although I don't have bigger experience with Elm, Purescript, Scala.js, Ceylon, Websharper & Co I guess its more complicated with them. An advantage here is also that Typescript does not bring along it's own standard library (e.g. new collection types) which could cause problems on interoperability. Another advantage is getting other people on board. Getting developers from pure JS to typescript is not difficult, especially when they are used to Java/C++/C# (which most developers are). The learning curve for the other languages will be higher for most developers.
- Sir_Cmpwn 11y agoSince adopting Redux, I've not seen many advantages of TypeScript. My codebase is just pure functions that describe simple state objects. What sort of advantages do I stand to gain by bringing in TS in this situation?
- deleted 11y ago[deleted]
- s986s 11y agoWhen implementing overloaded functions, explicitly defining an interface would allow for much easier debugging than testing it afterwards. Running tests (that can take up to seconds sometimes) is far less efficient than seeing the problem nearly immediately