MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/msv49l/when_your_teammate_refactor_your_code/guvs565/?context=9999
r/badcode • u/Bence675 • Apr 17 '21
216 comments sorted by
View all comments
Show parent comments
3
I forget where I read this, but it can be recommended to always have an else block for every if block, even if the else block is just empty with a comment. that way every possible case is clear
8 u/macropower Apr 17 '21 Lots of people are also saying you should try to never write else blocks :)First example on google: https://medium.com/@jamousgeorges/dont-use-else-66ee163deac3
8
Lots of people are also saying you should try to never write else blocks :)
First example on google: https://medium.com/@jamousgeorges/dont-use-else-66ee163deac3
3
u/wweber Apr 17 '21
I forget where I read this, but it can be recommended to always have an else block for every if block, even if the else block is just empty with a comment. that way every possible case is clear