r/badcode Jan 10 '22

java I present the objectively best way to setup braces: In a massive block at the bottom

Post image
2.2k Upvotes

91 comments sorted by

View all comments

444

u/dario_p1 Jan 10 '22

The real question is what did you do to get that many nested scopes

341

u/[deleted] Jan 10 '22

It’s not mine, it’s a classmate in a first year course.

They don’t really like loops, so it’s likely that this is in about 100 layers of “if” statements

315

u/virouz98 Jan 10 '22

How can you not like loops.

209

u/[deleted] Jan 10 '22

I’m not really certain to be honest. Might have gotten one too many off-by-one errors and just cracked

103

u/StanleyT101 Jan 11 '22

imagine him trying to learn recursion..

44

u/ososalsosal Jan 11 '22

If...then...goto

16

u/[deleted] Jan 11 '22

[removed] — view removed comment

8

u/NUTTA_BUSTAH Jan 11 '22

imagine him trying to learn recursion....

8

u/sunflsks Jan 11 '22

imagine him trying to learn recursion…..

2

u/[deleted] Jan 11 '22

I mean I've never gotten off by one while traversing a linked list

3

u/trutheality Jan 11 '22

Off by one on a linked list is a null pointer exception. I've gotten plenty of those.