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

If every design discussion we had in the review comments ended up as a comment in the code, the comments would be 10x longer than the code. There's one CL that I'm currently reviewing where the review thread is 41 messages long. That's not all that atypical for changes that require any sort of design discussion.

Though yeah, something that's a quick hack should have a " TODO(username): Fix hack. See review discussion in CL 12345678." to let the reader know that there's something else they should be aware of.

Basically, I think the code comments should say what the code does (and be rather sparse, usually, because you should be able to tell from the code itself), the commit comment should say what the change does, and the reviewlog should say what the code doesn't, i.e. roads not taken, design alternatives considered and rejected, tradeoffs made. The code always doesn't do far more than it does; putting that in the code comments makes it harder to follow what the code does do.



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: