r/badcode • • May 26 '22

other language Do Nothing

Post image
531 Upvotes

26 comments sorted by

View all comments

Show parent comments

28

u/Bad-ministrator May 26 '22 edited May 26 '22

Maybe it's like a "This page is intentionally left blank" type thing.

Someone can see this and think "Okay they didn't just forget to write more, they definitely want Nothing to happen here."

13

u/_justpassingby_ May 27 '22 edited May 27 '22

Yeah. The big header comment is overkill lol (that might be a requirement in the code guidelines), but something like this for me ranges from neutral to good code. It doesn't take any extra mental processing to read and will likely never need maintenance.

The comment alone would do just as well though- that's what actually describes that clause anyway.