You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ Only the `catch (error) {}` block represents actual control flow, while no progr
47
47
-[Why Not `data` First?](#why-not-data-first)
48
48
-[The Need for an `ok` Value](#the-need-for-an-ok-value)
49
49
-[A Case for Syntax](#a-case-for-syntax)
50
-
-[Why a Proposal?](#why-a-proposal)
50
+
-[Why This Belongs in the Language](#why-this-belongs-in-the-language)
51
51
-[Help Us Improve This Proposal](#help-us-improve-this-proposal)
52
52
-[Inspiration](#inspiration)
53
53
-[License](#license)
@@ -553,16 +553,13 @@ Without the `try` operator, the `Result` class is just one of many possible libr
553
553
554
554
<br />
555
555
556
-
## Why a Proposal?
556
+
## Why This Belongs in the Language
557
557
558
558
A proposal doesn’t need to introduce a feature that is entirely impossible to achieve otherwise. In fact, most recent proposals primarily reduce the complexity of tasks that are already achievable by providing built-in conveniences.
559
559
560
-
Optional chaining and nullish coalescing are examples of features that could have remained external libraries (e.g., Lodash's `_.get()` for optional chaining and `_.defaultTo()` for nullish coalescing). However, when implemented natively, their usage scales exponentially and becomes a natural part of developers’ workflows. This arguably improves code quality and productivity.
560
+
The absence of a standard `Result` type has led to widespread ecosystem fragmentation. The NPM registry contains hundreds of variations, and countless more exist as private, copy-pasted utilities. This leaves developers with a poor choice: risk adopting a library that may be abandoned, or contribute to the problem by creating yet another bespoke implementation.
561
561
562
-
By providing such basic conveniences natively, we:
563
-
564
-
- Increase consistency across codebases (many NPM packages already implement variations of this proposal, each with its own API and lack of standardization).
565
-
- Reduce code complexity, making it more readable and less error-prone.
562
+
This is the same problem that optional chaining (`?.`) and nullish coalescing (`??`) solved. **They replaced a landscape of competing utilities with a single, trusted language feature**. By standardizing this pattern, we provide a reliable primitive that developers can use with confidence, knowing it is a stable and permanent part of JavaScript. The goal is to end the fragmentation and establish a foundational tool for robust error handling.
0 commit comments