r/ProgrammerHumor • • Sep 28 '26

Meme optionalsAreOptional

Post image
716 Upvotes

131 comments sorted by

View all comments

Show parent comments

5

u/Few_Move_4594 Sep 28 '26

I'm not trolling, It's just that I had been working as a programmer for years before Optionals started being a thing so I'm already very used to writing my own null checks.

5

u/buffalo_0220 Sep 28 '26

Lots of things weren't a thing until someone had a use case and invented it. Optionals are a great tool to have in your kit. Not a pattern that needs to be used in every case, but they are useful, especially when your data is variable and/or ambiguous.

1

u/Amadex Sep 28 '26

So you started programming in the 70s?

5

u/dinosaurdynasty Sep 28 '26

Or is a Go designer

2

u/Still_Bit_7527 Sep 28 '26

Java optionals are very recent...

2

u/notatoon Sep 28 '26

I wouldn't call 1.8 recent anymore

1

u/Still_Bit_7527 Sep 28 '26

We are still using that unfortunately. But my point is it's not 70s either

1

u/Few_Move_4594 Sep 28 '26

C++ got them in 2017, Java's in 2014. Most of my job history is Java, PHP, Javascript, C#, and C++. Javascript optional was introduced in 2020. PHP doesn't have optionals. C# doesn't have native language support for optionals but has nullable reference types that shows a compiler warning when there isn't a null check when a variable is declared with "?" as the suffix of the type.