r/badcode • • Nov 10 '20

c++ My teacher's code formatting

Post image
983 Upvotes

60 comments sorted by

View all comments

34

u/hhellloo Nov 10 '20

The code itself doesn't look bad. Just the formatting.

68

u/ZedTT Nov 10 '20

Hence the title

19

u/hhellloo Nov 10 '20

Yeah, but the subreddit is bad code. And bad code practises is what I (and most likely others) expect on this subreddit.

73

u/ZedTT Nov 10 '20

Ehhhhh I think bad formatting kinda constitutes bad coding practices. Really hurts the readability. I think it fits the spirit of the sub pretty well.

20

u/hhellloo Nov 10 '20

You are right.

0

u/NahroT Nov 10 '20

Hence the upvotes

9

u/LeeHide Nov 10 '20

bad formatting is bad code. you might say

"you can just reformat it"

and yes, you can, but you cant do that if this is code in a repo that you have to commit your changes back to.

1

u/sporadicPenguin Nov 11 '20

Wait, why would you not be able to reformat then commit?

1

u/LeeHide Nov 11 '20

because it would likely change like half the file and if you commit that it becomes difficult to merge with other changes later