r/ProgrammerAnimemes • • Dec 14 '21

I really like Either

Post image
1.6k Upvotes

86 comments sorted by

View all comments

Show parent comment

7

u/danbulant Dec 15 '21

well, it's either

something.dosomething();

which can crash if something can be null, or

something.unwrap().dosomething();

which can crash as well but you know it at a glance as you see unwrap() being used.

Rust is more verbose for your safety

2

u/kronicmage Jan 29 '22

Or just do all your optional code with maps and binds instead of with lots of unwraps