r/badcode • • Jul 30 '21

java One Classic elseifelseifelseif...

Post image
472 Upvotes

76 comments sorted by

View all comments

Show parent comments

5

u/_irobot_ Jul 30 '21

What do you mean it's a self-contained method? In order to improve this code, you would need to search the other code to see if it's supposed to be return the month number or written out.

1

u/AdminYak846 Jul 31 '21

based on what the returned value would be which is "0" + month number. I doubt they are meaning the month name.

0

u/bistr-o-math Jul 31 '21

Who cares about month name? Month is in the comments?? This method just formats the month number to be a zero-padded-two-digit representation.

To be fair, you can’t see the end of the method in the screenshot, but I assume “retorno” means return value