News for hackers. Stuff that matters.
Re:Announcing TypeScript 2.0 by jeremiep on Friday September 23, 2016 @03:40PM (#12567378)
> The usefulness of types is in them describing the input/output dependencies in your code.

I agree, but I find types way too weak in that respect. Its not enough to know a function accepts ints; I want to know its range as well.

I spent so many weeks hunting down overflow and out-of-range errors and null pointer exceptions that types feel like an illusion of robustness at best.

> Now, how will immutability, hostility to state or unit testing help you with this question?

Not that much, I'll give you that. But the same is true for a function whose range was 1-20 being refactored into a range of 1-10; types won't catch that.

I used to like types, then testing, now I'm looking at specifications I can write once, compose and then generate assertions, documentation, test data and everything else from. Its by far the best ROI of the three.

Re:Announcing TypeScript 2.0 by spion on Saturday September 24, 2016 @01:54PM (#12571846)
> Its not enough to know a function accepts ints; I want to know its range as well.

Types actually help with this too. Instead of changing the possible range of a thing, change its name too: the compiler will quickly let you know of all the places that depend on it. Now you know what to check.