- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Can't believe I got to make the frist comment!
Also can't believe there's not a ton of comments already. Maybe comments are "Optional" today?
Admin
Optional.of(scneod)
Admin
One of those "it's"es is wrong. Shouldn't the Editor-in-Chief know the difference?
Admin
"Buggy" seems a bit off. What's a word for "full of bad/messy practices that are hard to refactor"? How about molasses code?
Admin
Optionalis IMHO the worst pattern. It really exists only because Java took forever to "natively" support non nullable types like the Kotlinvar? / var!pattern. It's really a bad workaround.(And don't get me started with Typescript where it's just sugar and a variable declared as non null can still manage to be undefined at runtime!)
Admin
WRONG. Optional is the correct way of expressing this. It is a data structure that allows you to explicitly declare that some place that would normally hold a value may not have a value.
What's completely mentally insane is treating uninitialized memory not as a bug that will crash the program in the best case, but as a language feature that can be used to idiomatically express a value that is not present, but then because that actually isn't wanted all the time, we create "non nullable types".
Optional isn't bad workaround for the lack of non nullable types, non nullable types are a bad workaround for null.
Sincerely,
a functional programmer.
Admin
Cleared for the option..
Admin
Person @keigezellig is a pilot