I'd actually really like to understand what kinds of problems it causes you, to better appreciate the communal obsession with an Option type
-
-
Replying to @BrandonBloom @mpenet
https://blogs.janestreet.com/making-something-out-of-nothing-or-why-none-is-better-than-nan-and-null/ … too easy for nonsense values to propagate; problems manifest distant from their root causes
1 reply 0 retweets 1 like -
Replying to @technomancy @mpenet
Yeah, that's fair. I've developed some defense mechanisms where most of my code has helpers for validating and dumping at key stages.
1 reply 0 retweets 0 likes -
For example, prior to spec, I had a dataflow graph in a compiler IR and I wrote a validation function. Then I ran it before/after every step
3 replies 0 retweets 0 likes -
Replying to @BrandonBloom @mpenet
heh so you're saying "nil isn't that bad as long as you build your own compiler to work around the problems it causes"
1 reply 0 retweets 2 likes -
Replying to @technomancy @mpenet
No no, the program I was writing was a compiler for something else entirely :-P
1 reply 0 retweets 0 likes -
I recalled it specifically because the invariants were complex and intermediate graphs necessarily passed through invalid states.
1 reply 0 retweets 0 likes -
Replying to @BrandonBloom @technomancy
pb for me is that everything is basically an opt type, but nothing in the compiler enforces you to handle it..
3 replies 0 retweets 0 likes -
Replying to @mpenet @BrandonBloom
you don't need the compiler's help for this--having to match against a tuple wrapper is plenty of reminder in Erlang.
2 replies 0 retweets 0 likes -
Replying to @technomancy @mpenet
Like I said, I definitely do want this to work in clj: (if-let [[x :ok] (some-op-with-a-return-code a b c)] on-success on-failure)
2 replies 0 retweets 2 likes
I find myself using spec more and more for destructuring. s/conform + case or match does wonders
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.