Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>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...

I tend to think of types and tests as attacking the same problem from opposite directions.



> 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.


Just checking for the @ symbol is fair game. Anything beyond that is a bad idea.


Agreed :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: