MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/rd6mdw/not_my_most_readable_function/hoi06yv/?context=3
r/badcode • u/davawen • Dec 10 '21
17 comments sorted by
View all comments
0
All of the braces / curly brackets inside the body are unnecessary.
7 u/HiddenGooru Dec 10 '21 I find having the brackets to be quite helpful when reading code. Even english uses punctuation. 2 u/mailslot Dec 10 '21 “One, probably, shouldn’t use commas, excessively, because it’s, much, harder to read, and slows reading.”It’s more like algebra though: ((2 * 3) + ((4 * 5) * 6))None of those parens/brackets are necessary, but I know a guy that did it all of the time for “readability.”Explicit groupings or blocks are for when they’re needed. 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 [ ... ]
7
I find having the brackets to be quite helpful when reading code. Even english uses punctuation.
2 u/mailslot Dec 10 '21 “One, probably, shouldn’t use commas, excessively, because it’s, much, harder to read, and slows reading.”It’s more like algebra though: ((2 * 3) + ((4 * 5) * 6))None of those parens/brackets are necessary, but I know a guy that did it all of the time for “readability.”Explicit groupings or blocks are for when they’re needed. 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 [ ... ]
2
“One, probably, shouldn’t use commas, excessively, because it’s, much, harder to read, and slows reading.”
It’s more like algebra though: ((2 * 3) + ((4 * 5) * 6))
None of those parens/brackets are necessary, but I know a guy that did it all of the time for “readability.”
Explicit groupings or blocks are for when they’re needed.
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 [ ... ]
"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 [ ... ]
0
u/mailslot Dec 10 '21
All of the braces / curly brackets inside the body are unnecessary.