you are viewing a single comment's thread
view the rest of the comments
[–] 21 points 3 years ago (6 children)

Lmao me commenting my 14 line bash script, comments almost as long as the script itself.

I have a habit of forgetting "why'd I put this there" and at least with my scripts I can leave myself a note for future me.

  • source
  • hideshow 6 child comments
  • [–] 3 points 3 years ago

    This actually makes a lot of sense. A computer executing the code and a human maintaining it need to know different things. A human needs to knon what the code does on a high level (what the programmer intended), how it handles (or does not handle) edge cases, etc. A computer only needs to know how to run the code at a super low level. Without comments, it is impossible to know if code is doing the right thing, or what is expected from the caller.

  • source
  • parent