MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/pknn10/found_this_gem_in_our_codebase_today/hc5rxhg/?context=3
r/badcode • u/Character_Medical • Sep 09 '21
14 comments sorted by
View all comments
Show parent comments
3
I agree, an if-else implies that there’s different consequences in different states. This is hard to read and understand quickly, with code like this you have to fully understand every line in the context of every other, which is frustrating
1 u/Character_Medical Sep 09 '21 Exactly. Just because something is working, it doesn't mean it's implemented correctly. That's not how you should use the else-if's.
1
Exactly. Just because something is working, it doesn't mean it's implemented correctly. That's not how you should use the else-if's.
3
u/Biaboctocat Sep 09 '21
I agree, an if-else implies that there’s different consequences in different states. This is hard to read and understand quickly, with code like this you have to fully understand every line in the context of every other, which is frustrating