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

Comments like "add one to index" are a symptom of laziness, not of commenting about the wrong thing. As an example, here is some of my actual code:

    /* Prompt for scheduler. */
    if (!flag_scheduler_selected && !flag_no_prompts) {
        option_scheduler = prompt_scheduler();
    }
The purpose of the comment is not to tell you what it is doing or why I'm doing it. The comment is there to tell you that what I am doing now has nothing to do with what came before. It signals a mental context switch. Without the comment, you wouldn't be able to easily scan the code and see where different things are happening.



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: