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

Even in such a small function comments may serve a useful purpose. For example, they could describe edge cases, when applicable ("a null text is considered an empty string" versus "a null text is an error", or "a zero number of duplications returns an empty string" versus "...returns a single text" and so on).


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

Search: