<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-design-of-optional-ye2k9nuut" -->

---
title: The Design of Optional | daily.dev
description: A deep dive into the design history of Java 8&#x27;s Optional type, drawn from the JSR-335 mailing list archives. The post traces how Optional was introduced...
canonical: https://daily.dev/posts/the-design-of-optional-ye2k9nuut
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Design of Optional | daily.dev
og:description: A deep dive into the design history of Java 8&#x27;s Optional type, drawn from the JSR-335 mailing list archives. The post traces how Optional was introduced...
og:url: https://daily.dev/posts/the-design-of-optional-ye2k9nuut
og:image: https://api.daily.dev/og/posts/Ye2K9nuut.png
og:image:alt: The Design of Optional
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Design of Optional

**[nipafx \(Nicolai Parlog\)](https://daily.dev/sources/nipafx)** · 12 min read · 0 upvotes · 0 comments

## Summary

A deep dive into the design history of Java 8's Optional type, drawn from the JSR-335 mailing list archives. The post traces how Optional was introduced primarily as a return type for stream terminal operations that may return no value, summarizing the heated debates among experts like Brian Goetz, Doug Lea, and Joshua Bloch. Key design decisions covered include keeping Optional intentionally limited, discouraging its use in collections, its value-based class semantics, and why equals/hashCode were added reluctantly. The author contrasts the expert group's narrow intended use (return types only) with a slightly broader personal recommendation: use Optional instead of null when a better design isn't feasible, but avoid it in collections.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nipafx.dev/design-java-optional>

---

Tags: [#java](https://daily.dev/tags/java), [#architecture](https://daily.dev/tags/architecture)

[View this post on daily.dev](https://daily.dev/posts/the-design-of-optional-ye2k9nuut)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The Design of Optional","url":"https://daily.dev/posts/the-design-of-optional-ye2k9nuut","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-design-of-optional-ye2k9nuut"},"datePublished":"2026-03-16T08:14:21.008Z","dateModified":"2026-03-16T08:26:32.392Z","description":"A deep dive into the design history of Java 8's Optional type, drawn from the JSR-335 mailing list archives. The post traces how Optional was introduced...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/69df12ced4a05f4aa5d7d720963b5747?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/69df12ced4a05f4aa5d7d720963b5747?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"nipafx (Nicolai Parlog)","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"nipafx (Nicolai Parlog)","logo":"https://media.daily.dev/image/upload/s--H_Echo_u--/f_auto,q_auto/v1773648772/logos/nipafx?_a=BAMAMiiu0","url":"https://daily.dev/sources/nipafx"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-design-of-optional-ye2k9nuut","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,architecture","timeRequired":"PT12M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"nipafx (Nicolai Parlog)","item":"https://daily.dev/sources/nipafx"},{"@type":"ListItem","position":3,"name":"The Design of Optional"}]}
```

