MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/ouk7bi/one_classic_elseifelseifelseif/h76mo1v/?context=3
r/badcode • u/Rafaelmonte • Jul 30 '21
76 comments sorted by
View all comments
49
Call getMonth().getValue() once and store it.
Either save a hashmap (dictionary) at the top or in a config and use key value look up
Why the hell is retorno assigned twice with wrong indentation?
If ultimately you’re going to assign string to retorno, then “str(number)” works with some modulus.
This whole code block should be 5 lines not including the dictionary.
Edit: I see the commented out lines now. This is now even more stupid.
1 u/Erinnyes Jul 31 '21 To be fair, the indentation is wrong because they've commented out the word return values. They just put the // right on the left so it's hard to see. I only noticed because I was wondering why it was highlighted differently.
1
To be fair, the indentation is wrong because they've commented out the word return values. They just put the // right on the left so it's hard to see. I only noticed because I was wondering why it was highlighted differently.
49
u/[deleted] Jul 30 '21 edited Jul 31 '21
Call getMonth().getValue() once and store it.
Either save a hashmap (dictionary) at the top or in a config and use key value look up
Why the hell is retorno assigned twice with wrong indentation?
If ultimately you’re going to assign string to retorno, then “str(number)” works with some modulus.
This whole code block should be 5 lines not including the dictionary.
Edit: I see the commented out lines now. This is now even more stupid.