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

>The code has a lot of comments. But not this kind:

    i++;  // Increment i
It does however have this:

    // Then we increment `current`
        current++;
Buy yes - the comments in the project is written as a tutorial, and are very good.


Aha! Good catch, especially given my comment about the comments.

Yeah, I wouldn't write that comment in production code either. But as you said, it's a tutorial, so why not go for it? :-)


I sometimes comment code like this, including the odd "increment". Because omitting it would disrupt the flow of the code+comments.


I've not read the example and I take your point but I'd much rather see "Then we increment the current so that..."


Maybe at the edge when it doesn't mean anything straightforward like a 'car++' in a meta class where a better name won't help or would be too long. But ya.


I wish every project I had to work on that wasn't "new" would have been written as a tutorial...




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

Search: