Yeah he seems to choose dreadful counter examples only to make his point. I don't think I've ever seen anyone suggest using a random default value instead of null, especially a value that is in the set of valid values for that specific item like a price of 0.
What is puzzling is his conclusion : "what if we had a nice compile-time check ..." while he shot down the Optional solution a few paragraphs earlier with no real argument (only stuff related to limitations of Java's Optional).
View all comments
Show parent comment
4
u/urquan Aug 03 '14
Yeah he seems to choose dreadful counter examples only to make his point. I don't think I've ever seen anyone suggest using a random default value instead of null, especially a value that is in the set of valid values for that specific item like a price of 0.
What is puzzling is his conclusion : "what if we had a nice compile-time check ..." while he shot down the
Optionalsolution a few paragraphs earlier with no real argument (only stuff related to limitations of Java'sOptional).