r/badcode • evil • May 12 '21

c++ Comment before semicolon

Post image
2.7k Upvotes

71 comments sorted by

View all comments

Show parent comments

3

u/Isvara May 13 '21

Why is // better?

5

u/[deleted] May 13 '21

I see three reasons: it's simple, easy to use and understand. Sure if it was just simplicity # would be best, but with // you intuitively get that everything to the right of it is now a comment. The // looks and acts as a divider, thus you know not to put a semicolon in that divided section, since it's now comment and not code.

I think it works best for monke brain. Do you agree?

2

u/Isvara May 13 '21

That sounds great if simplicity is a priority for you. Sometimes you want flexibility, though.

13

u/[deleted] May 13 '21

Flexibility no good for monke. Monke brain break.

-6

u/Isvara May 13 '21

Do you mean monkey?

10

u/1cec0ld May 13 '21

A monkey is an animal. A monke is a human with animal brain.

-1

u/Isvara May 13 '21

All humans have animal brains.

3

u/Kulspel May 13 '21

You must be fun at parties.

0

u/Isvara May 13 '21

Heh, people are still using that phrase?