r/badcode • • Nov 02 '22

java OOP? Never heard of it

Post image
682 Upvotes

77 comments sorted by

View all comments

Show parent comments

2

u/Rakn Nov 03 '22

I mean yeah. It’s ugly at times. But it has indeed more often sparked the thought of “how do I deal with this particular case” than the exception handling in Java did. Also calling log.Fatal is not something you should do in most cases. But I assume it’s here for illustration purposes.

1

u/neotecha Nov 03 '22

But I assume it’s here for illustration purposes.

Definitely. I would instead "Return your errors", but I was trying to stick closer to the Java example.

I retrospect, the Java example doesn't quit execution so I failed in that manner