The only time you might need an explicit else in my experience is when one or more conditions do not contain logic to leave the context (e.g. a return, break, or continue), and you have a block of code which should only be executed if none of the conditions were met.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You can't really "avoid" else statements though, if they are not explicitly there then it is still an implicit else.
I think he means explicit else. I mostly agree it adds unnecessary complexity, although there are exceptions.
However it's worded, it works. This article gives a good example: axelerant.com/resources/team-blog/...
Precisely.
The only time you might need an explicit
elsein my experience is when one or more conditions do not contain logic to leave the context (e.g. areturn,break, orcontinue), and you have a block of code which should only be executed if none of the conditions were met.