4 ms·
is there a term to describe the language design choice (reminds me of SQL, btw, where it is equally bad IMHO) where doing things to nil just returns nil without
by pmarreck 2y ago
is there a term to describe the language design choice (reminds me of SQL, btw, where it is equally bad IMHO) where doing things to nil just returns nil without erroring? I want to call it "bleeding nils/NULLs" if there isn't another term yet.
As stated, I think this design choice is terrible, especially if nil isn't equivalent to false in boolean comparisons (as it is in Ruby and Elixir- with Elixir actually providing two types of boolean operators with slightly different but significant behavior; "and" will only take pure booleans while "&&" will equate nil with false). It might mean cleaner-written code upfront but it's going to result in massively-harder-to-debug code because the actual error (a mishandled nil result) might only create a visible problem many stack levels away in some completely different part of the code.
- michaelcampbell 2y ago> where doing things to nil just returns nil without erroring Just call it a Result::Failure monad, say you meant to do that, and confuse legions of programmers for decades.
- pmarreck 2y agoLOL. I mean, that's in essence what it's trying to do, right?
- deleted 2y ago[deleted]