This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-10
Channels
- # beginners (356)
- # boot (4)
- # cider (44)
- # cljs-dev (73)
- # cljsrn (19)
- # clojars (5)
- # clojure (57)
- # clojure-brasil (2)
- # clojure-italy (1)
- # clojure-russia (9)
- # clojure-spec (9)
- # clojured (3)
- # clojurescript (15)
- # cursive (19)
- # datomic (10)
- # duct (3)
- # emacs (4)
- # events (1)
- # fulcro (5)
- # immutant (12)
- # keechma (3)
- # lein-figwheel (4)
- # lumo (2)
- # parinfer (11)
- # planck (4)
- # re-frame (3)
- # reagent (5)
- # reitit (1)
- # shadow-cljs (5)
- # spacemacs (6)
Hi everybody. I’ve been learning spec lately, and I think I have a decent grasp of its mechanics. What I don’t fully grasp is the real life effective use of spec. When should we be using spec? Should I be speccing as many of my functions and as much of my data as I can? Or just the borders? Or just what is publicly accessible?
there is no one right answer to that question
I don’t think you should or need to instrument everything
spec’ing at the borders is particularly helpful, but any function with sufficiently complex inputs or outputs is worth considering
instrumentation is worth using at dev time, check is worth doing at test time, and validation is (maybe) worth doing at runtime
we’re considering putting some (s/assert ...)
at the beginnings of some functions, which can be compiled away with the right system property
interesting thought on spec: https://twitter.com/pjstadig/status/972434922794373121
Well, disagree