News for hackers. Stuff that matters.
Re:Alan Donovan and Brian Kernighan Answer Questions on Go by mahyarm on Friday November 20, 2015 @06:16PM (#10604524)
I like how Swift does it. There are no real exceptions, but error object handling to jump to the end is fairly easy. It reduces boilerplate and increases readability.

  do {
    try error-return-statement
    statement
    statement
    try error-return-statement
  } catch ErrorType1 {
    ...
  } catch ErrorType2 {
    ...
  }
It looks like exceptions, but under the hood error objects are being returned by error-return-statements, thus the explicit try keywords before them. It retains go error object simplicity, but keeps things readable and tidy.

There are no comments on this comment yet.