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

> Unit tests validate invariants, but they don't express them in a concise form

I'd be more in line to say that if your Unit Tests aren't concise, then it's a problem with your Unit Tests, or at least, your implementation.

> and they're not a suitable form of documentation

Well, the output that you can generate form unit tests can easily be documentation, explaining in great detail exactly what can be done with what is being tested, without any hand waving either.

Still, that doesn't take away from everything else I said. In the end, if you rely on comments to explain your code, your code is probably lacking.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: