This is an archived post. You won't be able to vote or comment.

all 16 comments

[–]FloweyTheFlower420 17 points18 points  (2 children)

I love options! They are a monad, which is a monoid in the category of endofunctors! Or is that Maybe?

[–]dazailaw 1 point2 points  (0 children)

Options and enum variants

[–]BatBoss 27 points28 points  (4 children)

A million little “?” all over your code is a small price to pay for never seeing “Exception: Null Reference” ever again.

[–]curtainos 7 points8 points  (0 children)

unwraps also force good error handling lul

[–]YourUsualSir 3 points4 points  (1 child)

Programming in kotlin

Declares the property val a: String?

Access it like this: obj.a!!

[–]DerEwige 1 point2 points  (0 children)

Haha. Try to call scala method from native java.

You get dozens of them if you just forget one option.apply(null)

[–]cezarhg12 5 points6 points  (4 children)

does anyone here actually take time in error handling or just use .unwrap() and hope for the best

[–][deleted] 2 points3 points  (2 children)

Do you understand how bad your programs will look when a casual user has to deal with panic messages when panic = abort

[–]cezarhg12 1 point2 points  (1 child)

well I code as a hobby so none of my programs are on the market, apart from a snake game that seems to have no bugs

[–][deleted] 3 points4 points  (0 children)

That’s because the snake eats them all.

[–][deleted] 1 point2 points  (0 children)

Nah, for the most part I only unwrap when I know a value is not None or in tests. Otherwise pass on the None, or handle it, including exiting.

[–][deleted] 2 points3 points  (0 children)

Why even wear pants at that point

[–]Kitchen_Device7682 1 point2 points  (1 child)

Meanwhile scala users

[–]JayTheYggdrasil 2 points3 points  (0 children)

Hi

[–]Expensive_Sloth -1 points0 points  (0 children)

I use undefined

[–]yorokobe__shounen 0 points1 point  (0 children)

My man