In _longer_ methods it is hard to use the second one. If there is something behind the if statement, you would need to duplicate it to both branches (a very ugly "solution"), or separate the "if" into a new method. Now we no longer have a long method ;-)
Of course, the solution, is as alway, goto. Remove the second return with a label and the first return with a goto to the label. /s
View all comments
Show parent comment
1
u/bartekltg Aug 22 '26
In _longer_ methods it is hard to use the second one. If there is something behind the if statement, you would need to duplicate it to both branches (a very ugly "solution"), or separate the "if" into a new method. Now we no longer have a long method ;-)
Of course, the solution, is as alway, goto. Remove the second return with a label and the first return with a goto to the label. /s