News for hackers. Stuff that matters.
Re:All Programming Languages are Wrong (2018) by makapuf on Wednesday February 12, 2020 @01:57AM (#22306534)
Ive thought a bit about this, and how is Option types (which I like and prefer to error checking) really different from the compiler emitting an error when you fail to explicitely check for nulls and stdlib returning nulls when you have one ?
Re:All Programming Languages are Wrong (2018) by pasquinelli on Wednesday February 12, 2020 @02:21AM (#22306663)
That is what it is, a branch at the type level that the type checker mandates you complete both sides of.
Re:All Programming Languages are Wrong (2018) by bedobi on Wednesday February 12, 2020 @02:39AM (#22306737)
I think it's better, see the other reply at https://news.ycombinator.com/reply?id=22306638&goto=threads%...
Re:All Programming Languages are Wrong (2018) by quelltext on Wednesday February 12, 2020 @02:03AM (#22306556)
Because it forces (or at least strongly encourages) you/users of such a stdlib/API to explicitly think about and handle the null case and the non-null case if you want to access the contents directly / unwrap. At least that's the idea.