News for hackers. Stuff that matters.
Re:Ask HN: What tech stack would you choose for building you... by JamesBarney on Monday December 16, 2019 @07:19PM (#21809151)
It's great that you always write bug free code, but then typescript was not written for you, it was written for the rest of us who write the occasional bug, refactor an API that we didn't realize another developer was using, or can't quite remember the order or shape of args that a library call takes that we only use once every 6 months.
Re:Ask HN: What tech stack would you choose for building you... by arkanciscan on Monday December 16, 2019 @10:49PM (#21810340)
Why don't your tests catch your TypeErrors? You do have tests don't you?
Re:Ask HN: What tech stack would you choose for building you... by stevenwliao on Tuesday December 17, 2019 @02:38AM (#21811497)
Why would you write a test instead of a type declaration if you had the choice?
Re:Ask HN: What tech stack would you choose for building you... by arkanciscan on Wednesday December 18, 2019 @11:13AM (#21826309)
TS checks at buildtime. It can't guard against runtime TypeErrors because JavaScript is a dynamic language (despite all the effort to "fix" that). Tests can catch all TypeErrors, TS can't. Why use two tools to do the job that one can do alone?
Re:Ask HN: What tech stack would you choose for building you... by Can_Not on Tuesday December 17, 2019 @01:49AM (#21811275)
Tests aren't an alternative to types. They're better together.