News for hackers. Stuff that matters.
Re:Replacing Throwing Exceptions with Notification in Valida... by Animats on Saturday December 13, 2014 @06:17PM (#8746852)
The advantage of exceptions is that if the caller ignores the error, it gets detected anyway. The Go crowd argues that code should handle errors as normal events, but that leads to code with this repeated over and over:

   result, err := fn1()
   if err != nil {
      return err
   }
Or worse, the return is replaced with a "goto".

As for the original article, JSON is machine to machine communication. Why do you need to report more than the first error? One of the programs talking is broken. What next, parser error recovery for bad JSON?

Re:Replacing Throwing Exceptions with Notification in Valida... by dragonwriter on Saturday December 13, 2014 @06:48PM (#8746941)
> JSON is machine to machine communication. Why do you need to report more than the first error? One of the programs talking is broken. What next, parser error recovery for bad JSON?

JSON is a data serialization format; it might be used for machine-generated data, but it can also be used to serialize raw user input and transport it to another node for validation. For the latter use case, multiple errors can be important.

Re:Replacing Throwing Exceptions with Notification in Valida... by justincormack on Saturday December 13, 2014 @06:21PM (#8746866)
JSON is becoming less like that, the JSON might encode a form the user has filled in, and it might be reporting the set of validation errors, as part of the API.