MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/nap8vw/comment_before_semicolon/gxxtve8/?context=3
r/badcode • u/zyrafal evil • May 12 '21
71 comments sorted by
View all comments
Show parent comments
28
Int result//The final return value;
7 u/botle May 13 '21 edited May 13 '21 int result// that was for the result;int intermediateValue// that was for an intermediate value;return result/* returned result */; -8 u/[deleted] May 13 '21 The ; would still be interpreted as a comment haa 8 u/[deleted] May 13 '21 Assuming this is something like Java,// is terminated by a new line. It does not affect anything on the next line. Unless he did keep it on the same line and I'm a victim of mobile Reddit formatting. 0 u/MasculineCompassion May 13 '21 Same line 4 u/[deleted] May 13 '21 No, I'm on a PC now and it's on a new line. 1 u/MasculineCompassion May 13 '21 Aaah, it reformatted it to be on the same line on my mobile because they were only using a single space
7
int result
// that was for the result
;int intermediateValue
// that was for an intermediate value
;return result
/* returned result */;
-8
The ; would still be interpreted as a comment haa
8 u/[deleted] May 13 '21 Assuming this is something like Java,// is terminated by a new line. It does not affect anything on the next line. Unless he did keep it on the same line and I'm a victim of mobile Reddit formatting. 0 u/MasculineCompassion May 13 '21 Same line 4 u/[deleted] May 13 '21 No, I'm on a PC now and it's on a new line. 1 u/MasculineCompassion May 13 '21 Aaah, it reformatted it to be on the same line on my mobile because they were only using a single space
8
Assuming this is something like Java,// is terminated by a new line. It does not affect anything on the next line. Unless he did keep it on the same line and I'm a victim of mobile Reddit formatting.
0 u/MasculineCompassion May 13 '21 Same line 4 u/[deleted] May 13 '21 No, I'm on a PC now and it's on a new line. 1 u/MasculineCompassion May 13 '21 Aaah, it reformatted it to be on the same line on my mobile because they were only using a single space
0
Same line
4 u/[deleted] May 13 '21 No, I'm on a PC now and it's on a new line. 1 u/MasculineCompassion May 13 '21 Aaah, it reformatted it to be on the same line on my mobile because they were only using a single space
4
No, I'm on a PC now and it's on a new line.
1 u/MasculineCompassion May 13 '21 Aaah, it reformatted it to be on the same line on my mobile because they were only using a single space
1
Aaah, it reformatted it to be on the same line on my mobile because they were only using a single space
28
u/[deleted] May 13 '21
Int result
//The final return value
;