News for hackers. Stuff that matters.
Re:Deprecating: java.util.Optional.get()? by lmm on Thursday April 28, 2016 @01:33PM (#11590540)
Sure - you need casts or a similar feature. You don't need standard library methods that do casts, though, and having them invites trouble IMO.
Re:Deprecating: java.util.Optional.get()? by pcwalton on Thursday April 28, 2016 @02:00PM (#11590721)
Library methods are preferable to added language complexity.
Re:Deprecating: java.util.Optional.get()? by lmm on Thursday April 28, 2016 @02:19PM (#11590873)
You need the language functionality of casting anyway, no? Best that there's one and only one way to step around the type system.
Re:Deprecating: java.util.Optional.get()? by pcwalton on Thursday April 28, 2016 @03:12PM (#11591229)
No, you need pattern matching, which does not offer a convenient way to write Option.get().