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

As an aside, is no one else bothered by the ubiquitous null/undefined checks? Almost every function implementation here is started with checking that the args are actually what is expected.

I get that typescript is only a compile time check and doesn't guarantee type correctness at runtime, but if I feel like there might be larger problems here to solve first if my function takes in type string and the first thing I have to do is make sure it's not null or undefined. If you legitimately expect either a string or null, there are proven ways to deal with this (Maybe/Optional).



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

Search: