Hacker News new | ask | show | jobs
by throwaway234239 1345 days ago
Probably the best is learning null-safe types and why it is important for basic hygiene.

When you don't learn elementary type-safety, you create languages like Java and Go which are plagued with NullPointerException's and nil panics.

So please, learn an ML (and a Lisp).

2 comments

I agree that learning ML style languages has benefits, when I discovered the concept of "Option" the ideas behind pattern matching and functional programming made a lot more sense, especially when it comes to writing systems software. But for some reason your comment reminds me of James Mickens quote from "USENIX: The Night Watch" article[1] "You can’t just place a LISP book on top of an x86 chip and hope that the hardware learns about lambda calculus by osmosis"

[1]: https://www.usenix.org/system/files/1311_05-08_mickens.pdf

"null-safe type" is a term which takes the perspective of backpedaling out of a mistake, which keeps highlighting the mistake. The mistake is unnecessary in the first place; types do not naturally have a null in them that has to be exorcised.

For instance, when we think of a type like "the natural numbers", that's just a set of 1, 2, 3, ... there is no "null reference to Integer" in there.

Thus I think terms like "null-safe type" is just something we should leave to Java programmers, and not use as a way to talk about types.