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

I started liking this convention when I started considering the tests documentation. In my code, the first unit test for any function is always the simple common case, and having that right next to the function usually makes the code easier to read.


You should move it to a documentation block, given that doc examples are also run as tests. Then your users can see them too. Win-win!




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

Search: