Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And compilers are effectively a rudimentary form of test. They are not sufficient, nor necessary but they do validate some basic assumptions about the code.


They also remove redundant testing (you only need to prove something fulfills certain properties once as long as you have a type for it); and the more advanced the type system the fewer tests needed.


friendly tips: runtime type checks are available https://github.com/gcanti/io-ts https://github.com/pelotom/runtypes


I mention io-ts https://github.com/gcanti/io-ts in the post


Thanks for the article It sparked useful discussion around the world


If for no other reason, I would like Typescript for flagging when you typo some property - e.g. foo.FooID vs foo.FooId.

I've lost a stupid amount of time in regular JS because of things like this that make me want to pick up the computer and throw it out the window.


Decent editor does that now. I'm using atom on daily basis and it's helping me with that. VScode and intellij does the same


Doesn't the functionality for that in most editors leverage typescript typings, so that it's not really independent of typescript?


Ah I misread the parent comment. I thought it was more like "I wish typescript has this anti-typo functionality"

You're right that it's not independent from TS.


you can add JSDoc annotations and use a modern IDE like vscode or webstorm, etc.


I would upvote you twice if I can for that compiler is a test thing




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: