Re:Super Tiny Compiler
by noselasd on Thursday March 31, 2016 @04:30AM
(#11395762)
>The code has a lot of comments. But not this kind:
It does however have this:
Buy yes - the comments in the project is written as a tutorial, and are very good.
[ Parent
| on HN ]
Re:Super Tiny Compiler
by Stratoscope on Thursday March 31, 2016 @04:35AM
(#11395786)
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? :-)
Re:Super Tiny Compiler
by wingerlang on Thursday March 31, 2016 @05:58AM
(#11396029)
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.