logoalt Hacker News

knoctetoday at 1:39 PM4 repliesview on HN

From your blog entry:

> Go was not satisfied with one billion dollar mistake, so they decided to have two flavors of NULL

Thanks for raising this kind of things in such a comprehensible way.

Now what I don't understand is that TypeScript, even if it was something to make JavaScript more bearable, didn't fix this! TS is even worse in this regard. And yet no one seems to care in the NodeJS ecosystem.

<selfPromotion>That's why I created my own Option type package in NPM in case it's useful for anyone: https://www.npmjs.com/package/fp-sdk </selfPromotion>


Replies

symaxiantoday at 3:18 PM

You can enable null safety in TypeScript, seems like a pretty good fix to me.

show 2 replies
alpinismetoday at 2:14 PM

Your readme would really benefit from code snippets illustrating the library. The context it currently contains is valuable but it’s more what I’d expect at the bottom of the readme as something more like historical context for why you wrote it.

show 1 reply
euroderftoday at 3:48 PM

"A typed nil pointer is not a nil pointer."

smt88today at 2:02 PM

How would TS fix null in JS without violating its core principles of adhering to EcmaScript standards and being a superset of JS?

show 1 reply