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

> If I don't do this, when I come back to the code an hour later I have no idea what its supposed to do or why I wrote it.

I think the point that the tweet is trying to make is that if you comment, you should explain why you are doing something instead of saying what you are doing. The latter is already written there, in code.



This is one of a few of my programming pet peeves. So many people I work with add comments which are completely just re-stating the code that follows. Ruby is particularly bad for this, at least visually.

  # authenticate user
  user.authenticate!




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: