this post was submitted on 14 Aug 2023
1370 points (97.9% liked)

Programmer Humor

19817 readers
59 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] fkn 36 points 1 year ago (1 children)

Also Go: exceptions aren't real, you declare and handle every error at every level or declare that you might return that error because go fuck yourself.

[–] zorro 54 points 1 year ago (4 children)

Because that's sane and readable?

[–] fkn 22 points 1 year ago (1 children)

Wow. I'm honestly surprised I'm getting downvotes for a joke. Also, no. It isn't. It really isn't.

[–] gornius 2 points 1 year ago (2 children)

It is better than in most languages with exceptions, except from languages like Java, that require you to declare that certain method throws certain error.

It's more tedious in Go, but at the end of the day it's the same thing.

When I use someone else's code I want to be sure if that thing can throw an error so I can decide what to do with it.

[–] fkn 2 points 1 year ago* (last edited 1 year ago)

Java doesn't have to declare every error at every level... Go is significantly more tedious and verbose than any other common language (for errors). I found it leads to less specific errors and errors handled at weird levels in the stack.

[–] GlitchSir 1 points 1 year ago

You know it’s social media when the one that’s right is downvoted

[–] [email protected] 20 points 1 year ago (1 children)

It's better than "invisible" exceptions, but it's still the worst "better" version. The best solution is some version of the good old Result monad. Rust has the BEST error handling (at least in the languages i know). You must handle Errors, BUT they are just values, AND there's a easy, non-verbose way of passing on the error (the ? operator).

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Beyond a quick "hello world" when it came out, I've never used rust, but that sounds pretty great

[–] [email protected] 12 points 1 year ago

I'm with you, exceptions sound good but are a bug factory.

[–] herrvogel -2 points 1 year ago

There's nothing sane and readable about how Go insists you format dates and time. It is one of the dumbest language features I've ever seen.