3 ms·
Given that exposure to `goto` is going to be minimal born most developers born after 1980's, the use of `goto` is likely to appear more convoluted. At any rate
by II2II 2y ago
Given that exposure to `goto` is going to be minimal born most developers born after 1980's, the use of `goto` is likely to appear more convoluted.
At any rate, the greatest danger in this case lies in the code duplication. If performance is not an issue, stick it in a function. If performance may be an issue, start off by sticking it in a function and see if compiler optimizations take care of the issue. If performance is an issue, by all means force it to do what you want by using `goto`.
While there is nothing intrinsically evil about `goto`, most of the developments in programming languages were meant to overcome challenges of the past. We shouldn't dump those developments based upon exceptions to the rule. Rather, we should recognize exceptions to to rule as being extraordinary circumstances in which those developments were not useful.
- bazoom42 2y ago> start off by sticking it in a function and see if compiler optimizations take care of the issue. You could also just use a goto and avoid the accidental complexity. I still dont understand why a complicated workaround is better than a simple goto.