10 ms·
Perhaps. I was trying to find something pithy to give as an example. It's difficult to express all the things about spec that feel off to me. I'll try to enumer
by keithasaurus 7y ago
Perhaps. I was trying to find something pithy to give as an example. It's difficult to express all the things about spec that feel off to me. I'll try to enumerate some:
- verbosity (I think schema does this better https://github.com/plumatic/schema https://github.com/plumatic/schema)
- because it tries to not be about validating types of inputs and outputs, and rather treats everything as predicates, it tends to live in a grey area between type validation and unit-testing, and I think hinders both
- it only helps at run-time
- over-abundance of macro-usage
- thom 7y agoI suspect what you consider a 'gray area', spec considers the whole point. What is the specification for this function? It has a signature and a return value and some behaviour in between. Spec verifies all of that together because it doesn't make sense to do it separately. Also I'm not sure what you mean about run-time, you can and should use spec as part of your development workflow. Other two points are totally fair though, and the macros are part of the reason it never got out of alpha before a rewrite.
- andreareina 7y agoFair. I find that I naturally tend to think about the general properties of argument/return values and not just the types (or perhaps equivalently expand the meaning of "type" to encompass such usage) so I like the design, but I haven't yet used spec in anger and so might yet change my mind.