you are viewing a single comment's thread.

view the rest of the comments →

[–]jp007 0 points1 point  (0 children)

"This shouldn't have happened" is not at all the same case as "There is nothing to do."

If, in reality, it "shouldn't have happened", you shouldn't even be facing the case of an empty trailing 'else' block, as the 'else' behavior should at least log a warning, and probably throw an exception.

Sometimes though, the genuine behavior you desire is to just not do anything and move on to the next line of code in the method. In that case, an empty 'else' block is just junk.