News for hackers. Stuff that matters.
Re:State of Clojure 2020 by GeneralTspoon on Friday February 21, 2020 @05:06AM (#22382098)
Yes but once the json has been validated once at runtime, you know it's safe for the rest of your program to use.

Whereas in a dynamic language (even an immutable one), your data could be mutated during program runtime and no longer conform to the type you expected. Yes you could re-validate it everywhere, but that requires you to exercise every code path when testing at runtime to find bugs.

I think the general argument that "You can't static type everything (like your API dependencies), so there's no point in doing it all" isn't a very solid one.

Re:State of Clojure 2020 by int_19h on Friday February 21, 2020 @07:36PM (#22388504)
Your data can't be mutated if you're using immutable data structures. Which is what Clojure defaults to, in fact.
Re:State of Clojure 2020 by GeneralTspoon on Saturday February 22, 2020 @07:06PM (#22394192)
I didn't mean literally mutating the same structure in place - but a new version of your data structure could be returned from a function which changes some of the keys/values in unsafe ways.