4 ms·
>In a pure language, signatures are extremely close to documentation (you know exactly what a function will do by its signature). The same can be true of tests
by pytester 8y ago
>In a pure language, signatures are extremely close to documentation (you know exactly what a function will do by its signature).
The same can be true of tests. I've started generating API documentation from mine: e.g. https://hitchdev.com/strictyaml/using/alpha/scalar/email-and-url/ https://hitchdev.com/strictyaml/using/alpha/scalar/email-and...
I tend to think of types and tests as attacking the same problem from opposite directions.
- sethammons 8y ago> StrictYAML can validate emails (using a simplified regex) Public Service Announcement: don't validate emails with regex. Every time you do, god kills a kitten.
- pytester 8y agoJust checking for the @ symbol is fair game. Anything beyond that is a bad idea.
- sethammons 8y agoAgreed :)