3 ms·
it looks quite disturbing without them Remove the newline and it looks ok to me: int i = 42; do printf("hey\n"); while (--i > 0); Another possibi
by cygx 11y ago
it looks quite disturbing without them
Remove the newline and it looks ok to me:
int i = 42;
do printf("hey\n");
while (--i > 0);
Another possibility would be:
int i = 42;
do printf("hey\n");
while (--i > 0);
- viraptor 11y agoOohh... this would be so good for the underhanded C contest! Just mix is up with the comments which make the `do` look like (assuming good actor) an accidentally wrapped comment. /* The following code does something, so here's the // explanations of what happens. And here's what we actually */ do printf("hey\n"); /* And now just count down */ while (some_check(--i)); Now spot that in a large file of real code!
- pierrec 11y agoSneaky. Most syntax highlighting would make it stick out like a sore thumb, but still, sneaky.
- gpvos 11y agoJust looking ok is not the point. I would prefer a match between how it looks and what it does...
- dllthomas 11y agoI agree, but I don't see that undermined here.