Re:Announcing the Second Edition of “Refactoring”
by dgreensp on Tuesday March 27, 2018 @02:46PM
(#16691547)
TypeScript is fast becoming the go-to language for JavaScript with types.
Re:Announcing the Second Edition of “Refactoring”
by edem on Monday April 02, 2018 @05:20PM
(#16739443)
They still didn't manage to put together a usable language. Just try to import your `Foo` class into `Bar` and your `Bar` class into `Foo`. BOOM! It will explode into your face. And this is just a basic thing which should work in a real language.
Re:Announcing the Second Edition of “Refactoring”
by jmsaucier on Tuesday March 27, 2018 @02:55PM
(#16691650)
I will second this. I've seen some people choose FB's Flow as their type checker, but for me, I'm loving Typescript. It has minor problems when it has to use DefinitelyTyped and integrate with other frameworks, but those are minor in comparison to not having it.
Re:Announcing the Second Edition of “Refactoring”
by SlySherZ on Tuesday March 27, 2018 @05:37PM
(#16692952)
Yes, there is JSDoc[1] which allows you to add type annotations in comments, that can then be used by some tool.
The VSCode editor is able to leverage the TypeScript engine even with vanilla JS to automatically infer types and also supports JSDoc. Basically you write vanilla JS, add JSDoc comments here and there when the inference doesn't work as you want and it gives you most benefits of a typed language, without tying yourself to a specific ecosystem (your teammates could be using something else entirely). It works pretty well.
Re:Announcing the Second Edition of “Refactoring”
by Karunamon on Wednesday March 28, 2018 @12:21PM
(#16699039)
This is more what I was looking for; the others appear to be supersets of JS.
Re:Announcing the Second Edition of “Refactoring”
by avarun on Tuesday March 27, 2018 @02:54PM
(#16691639)
Flow does this very well. https://flow.org/
But does anything similar exist in JS land?