News for hackers. Stuff that matters.
Re:Java 8’s new Optional type doesn't solve anything by pcwalton on Monday October 26, 2015 @11:33AM (#10452083)
If we didn't provide it, someone would write it. (Actually, I suspect lots of libraries would just have it.) You can't force people to write good code.

This presupposes that the pattern that "unwrap" wraps is always a bad thing anyway, which it isn't. Sometimes the right thing to do is to panic your program if None is present. And sometimes the type system isn't sophisticated enough to express an invariant, and you need to use "unwrap" to work around it.

By the way, the borrow checker has nothing to do with unwrap().

There are no comments on this comment yet.