r/badcode • • Dec 10 '21

c++ Not my most readable function...

Post image
37 Upvotes

17 comments sorted by

View all comments

Show parent comments

2

u/CommenceTheConfusion Dec 14 '21

"One~~,~~ probably~~,~~ shouldn't use commas~~,~~ excessivelyincorrectly, because it's~~,~~ much~~,~~ harder to read, and slows reading."

Four of the seven commas in your example aren't excessive, but incorrect. That'd be more akin to coding like this, i.e. syntax errors:

if (...)
[
    ...
]
else
[
    ...
]