Our teams have a setup including clj-Kondo for linting, Re-frame, and Reitit for data-driven development. There are many other places in our work that follow the same pattern, building maps that guide our program activity. Recently we again dealt with a common experience: sadly lengthy trouble-shooting that boiled down to a mistyped keyword in one of our data maps, resulting in silent and mysterious failures when the program ran. In this case, it was a keyword for re-frame consumption (resulting in the reframe things operating with a
nil input because the key they were looking for was mistyped). Kondo couldn’t find it because it’s just a new cljs map we’re passing to the parser.
This seems like a price paid for the dynamic nature of Clojure, and I’m curious how other experiences have approached this. Do you:
- Blame it on experience; the problems of mistypes are on the developer, and will be reduced with experience.
- Spec or validate everything, constraining input. But this is harder when using 3rd-party libraries, and it’s cumbersome.
Or something else?