News for hackers. Stuff that matters.
Re:Announcing TypeScript 2.0 by wvenable on Friday September 23, 2016 @11:23AM (#12565277)
> What good is having a int type if you can't limit its range?

Well then you don't have to test what happens when someone passes a string, an object, or a boolean. Most dynamic languages will silently convert many of these values into an int and produce incorrect results.

> I'm not going to maintain BOTH static types and tests.

You have to maintain documentation and you have to maintain tests and you have to maintain assertions for the implied types of your functions anyway so you might as well make them explicit in the code.

Re:Announcing TypeScript 2.0 by jeremiep on Friday September 23, 2016 @12:06PM (#12565610)
> Well then you don't have to test what happens when someone passes a string, an object, or a boolean.

That's useless, I still need to test the value's range which implicitly checks the type.

> You have to maintain documentation and you have to maintain tests and you have to maintain assertions

Not if I can generate most of it from the specification data.