Optional - The Mother of All Bikesheds by Stuart Marks
Channel:Devoxx · Length:58:42 · Published:2016-11-11 · Views:63427
Summary
Stuart Marks explains the intended purpose and proper use of Java 8's Optional class and why it caused so much controversy. He gives guidelines for using its small API correctly.
Why HN recommends it
Cited as the authoritative explanation, from the person who added it to OpenJDK, of Optional's narrow intended purpose.
the guy who added it to OpenJDK — HN, 2019
Python, Ruby & scripting languages · Software architecture & design
Subtitles (excerpt)
good morning thank you for coming my name is Stuart marks I work in the core libraries team in the JDK group at Oracle so today's talk is optional the mother of all bike sheds I'm not really going to explain all that this is about but the notion of bike shed is that optional seems to be a pretty simple class but it's generated email discussions far out of proportion with the amount that's going on in it or the amount that's apparently going on in it and it seems like under the covers or around the covers there's a lot more that's going on that might meet the eye hence this talk so what I'm going to do is just go over the basics of optional what it is why it's useful and show some use cases about it then show what I believe are the preferred techniques for using optional then I'm going to talk about some counter examples or anti-patterns or what I call abstruse use or even abuse of of the optional class and go through a set of examples of reasons of ways that I believe you should not use optional then I'll get into some a little bit of discussion about the design rationale and that that's that's where the bike shedding comes in all right optional why is it useful so background is the
On Hacker News
See also the discussion for a similar feature in Java, from "Optional: The Mother of all Bikesheds", where the use and misuse of get() has a central role. video: [VIDEO] slides: [LINK] — cratermoon, 2022-07
These are pretty weak arguments For the first point - val/var "More importantly, it doesn’t offer its immutable counterpart, val. You still need to add the final keyword, which nearly nobody uses." This super undermines the criticism. "It has the feature but people don't use it" isn't exactly much to write home about. Just use `final var` if you want. Make "final var over var" the same force cult… — emccue, 2022-06
That's not really "why" it was introduced. Optional is used as a null wrapper in other JVM languages so that idiom bled over pretty naturally. Here's a talk "Optional - Mother of all Bikesheds" by Stuart Marks, the guy who added it to OpenJDK: [VIDEO] It was mostly just meant to cover the zero or one case on fluent-style interfaces like the Streams API, so check as getFirst() or getAny(). In hind… — kjeetgill, 2019-06
Related videos
- Ruby Conf 12 - Y Not- Adventures in Functional Programming by Jim Weirich · Confreaks · 53:21
- The spelled-out intro to neural networks and backpropagation: building micrograd · Andrej Karpathy · 2:25:52
- How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework · Видео с мероприятий {speach! · 49:55
- RailsConf 2014 - All the Little Things by Sandi Metz · Confreaks · 38:47
- "Simple Made Easy" - Rich Hickey (2011) · Strange Loop Conference · 1:01:38
- What the heck is the event loop anyway? | Philip Roberts | JSConf EU · JSConf · 26:52
- "Making Impossible States Impossible" by Richard Feldman · elm-conf · 25:06
- How To Design A Good API and Why it Matters · Google TechTalks · 1:00:19
- The Problem with Time & Timezones - Computerphile · Computerphile · 10:12
- The Value of Values with Rich Hickey · InfoQ · 31:43
- Overwatch Gameplay Architecture and Netcode · GDC Festival of Gaming · 1:04:03
- Solving Problems the Clojure Way - Rafal Dittwald · Clojure/north · 1:02:26
- Lecture 1A: Overview and Introduction to Lisp · MIT OpenCourseWare · 1:12:55
- Alan Kay - Normal Considered Harmful · powerfuloutlet · 1:07:26
- RailsConf 2016 - Turbolinks 5: I Can’t Believe It’s Not Native! by Sam Stephenson · Confreaks · 37:37
- A Philosophy of Software Design | John Ousterhout | Talks at Google · Talks at Google · 1:01:40