r/badcode • • Jun 02 '20

java return 2;

Post image
1.2k Upvotes

29 comments sorted by

View all comments

98

u/whattheclap Jun 02 '20

The fact that there’s no argument means that this is probably used to operate with 2 on another number

115

u/[deleted] Jun 02 '20

It was not! It was used to append “2” to a few strings. I removed it, but I really considered leaving it because it’s hilarious.

65

u/[deleted] Jun 02 '20

[removed] — view removed comment

40

u/toastedcroissant227 Jun 03 '20

Not misleading. Clearly you start by appending “number” (1) to the string, then you append “increment ByOne” (2) to the string when you need to increment by 1, then, logically, you would append “incrementIncrementByOneByOne” (3) to the string when you needed to increment by 1 again, then “incrementIncrementIncrementByOneByOneByOne” (4) when you needed to increment again, and so on.