Re:Facebook Launches Flow, Static Type Checker for JavaScript
by jbergens on Wednesday November 19, 2014 @10:50AM
(#8630642)
And in a large app it is hard to know if all relevant code has ran. Finding pieces that uses the code you just changed is much easier in static languages. We might not go to a fully statically typed javascript but supporting optional typing seems like a really good idea.
Re:Facebook Launches Flow, Static Type Checker for JavaScript
by ajuc on Wednesday November 19, 2014 @11:18AM
(#8630827)
Yes I know, I mostly work in java these days.
BTW it's funny how many times late binding was reinvented in j2ee ecosystem :)
Re:Facebook Launches Flow, Static Type Checker for JavaScript
by Cthulhu_ on Wednesday November 19, 2014 @06:48AM
(#8629483)
But JS does not have compile-time - you edit it, and you run it, no steps in between. If set up right you've got your unit tests running automatically whenever something changes.
Interstingly it's almost always the same kind of type error- accessing nested maps/arrays and forgetting to go deep enough before I call some method on the elements in that collection.
I can't remember one example of type error where I intended to call method on MyClassA and ended up trying to call it on MyClassB. But that may be the effect of my coding style (I'm not big fan of class hierarchies in js).