News for hackers. Stuff that matters.
Re:V8n – Fluent validation library for JavaScript by lgessler on Sunday July 15, 2018 @12:28PM (#17535879)
It seems like the main purpose of the exception-based validation function `check` is to provide an explanation for failures. Could this have also been achieved by returning an error object with the same information in it? This is what clojure.spec does: https://clojure.github.io/spec.alpha/clojure.spec.alpha-api....
Re:V8n – Fluent validation library for JavaScript by LinaLauneBaer on Sunday July 15, 2018 @01:22PM (#17536108)
Sometimes you want to do a lot of other stuff in the same scope and simply bail out on any error without having to check every return value.