Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

No, it doesn't in this case. The multiple return values make it impossible to accidentally ignore an error.


It requires at least 3 lines for every function call unless you ignore errors. Exceptions allow you to catch them without boiler-plate for each function.

  if result, ok := func(arg); !ok {
      // handle error
  }
  // process result ..other stuff
On the other hand channels & goroutines allow in principle less verbose mode at the cost of additional parameter to every function in a stack.

  errors := make(chan Error)
  go handle_errors(errors) // read from errors
  // ...
  result := func(arg, errors) // write to errors in case of an error
  // process result ..other stuff




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: