5 ms·
I remember spec being pitch for something you only use at dev time and turn off in production because it makes your runtime very very slow, what has change? See
by Scarbutt 7y ago
I remember spec being pitch for something you only use at dev time and turn off in production because it makes your runtime very very slow, what has change? Seems users are using it for everything now.
- nickik 7y agoNo. It was always designed to be configurable so you can keep on the API endpoints, but deactivate them internally.
- dancek 7y agoWe don't have instrumentation in production, ie. we spec much more at dev time. But for things you'd validate anyway spec is a good match and probably about as performant as hand-written validation. The only strange use of spec I mentioned is validating db queries. For us updates and deletes are rare enough that perf doesn't matter.
- fulafel 7y agoI bet you are thinking of https://clojure.org/guides/spec#_instrumentation_and_testing https://clojure.org/guides/spec#_instrumentation_and_testing - it was always just one use of spec among many.
- seancorfield 7y agoSpec has numerous uses. We use it heavily in production for data validation/conformance: https://corfield.org/blog/2019/09/13/using-spec/ https://corfield.org/blog/2019/09/13/using-spec/