News for hackers. Stuff that matters.
Re:Deprecating: java.util.Optional.get()? by neverminder on Thursday April 28, 2016 @10:49AM (#11589258)
Java Optional was inspired by Scala Option was it not? And I haven't seen anyone complain about Scala Option having exactly the same get() method for ages.
Re:Deprecating: java.util.Optional.get()? by haimez on Thursday April 28, 2016 @10:54AM (#11589290)
It does, but the scala community is very familiar with the functional ("lambda") approach of leaving values in an optional context while transforming it.

The issue here stems from the existing community's culture, one especially full of trivially safe getters.

Re:Deprecating: java.util.Optional.get()? by neverminder on Thursday April 28, 2016 @11:04AM (#11589376)
Well, maybe they need to learn the lesson the hard way, because when they start doing `foo.getBar().map(this::toString).orElse("Bar not found");` they will realize (hopefully) that this looks much more like Scala than classic Java.
Re:Deprecating: java.util.Optional.get()? by lmm on Thursday April 28, 2016 @11:33AM (#11589603)
The ScalaZ folks use their own Maybe type instead so as not to have a get() method. Wartremover makes Option#get() a compile failure. Where I work "Option#get" is an automatic failure in codereview. For political reasons I doubt it will ever be removed in the Scala standard library, but there is certainly a substantial contingent that objects to it.
Re:Deprecating: java.util.Optional.get()? by rco8786 on Thursday April 28, 2016 @10:53AM (#11589284)
I think it has to do with the mindset of people working with Java vs Scala. Specifically, Scala folks are taught to reach for functional concepts(map, flatMap, etc) first whereas these concepts are still new to Java land.
Re:Deprecating: java.util.Optional.get()? by eloisant on Thursday April 28, 2016 @11:22AM (#11589514)
I believe less Scala developers do "IDE-driven-development", where they just briefly look at the auto-complete to find a methods that vaguely appears to do what they want.