this post was submitted on 13 Sep 2024
61 points (86.7% liked)

Programming

17248 readers
300 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 20 points 1 month ago (5 children)

You have to explicitly check if the return value is an error and propagate it. You write the same boilerplate if (err) return err over and over again, which just litters your code.

That’s only true in crappy languages that have no concept of async workflows, monads, effects systems, etc.

Sad to see that an intentionally weak/limited language like Go is now the counterargument for good modeling of errors.

[–] lysdexic 3 points 1 month ago

That’s only true in crappy languages that have no concept of async workflows, monads, effects systems, etc.

You don't even need to sit on your ass and wait for these data types to be added to standard libraries. There are countless libraries that support those, and even if that is somehow not an option it's trivial to roll your own.

load more comments (4 replies)