4 ms·
I've come across a couple of (admittedly niche) cases where C++ code benefits from a goto: - In some very performance sensitive cases. It helps you skip a bunc
by dataflow 4y ago
I've come across a couple of (admittedly niche) cases where C++ code benefits from a goto:
- In some very performance sensitive cases. It helps you skip a bunch of extra checks or variables.
- When you need to convert recursion to iteration, but want to keep the code structure mostly intact so you don't mess up the source control history.
- ncmncm 4y agoAgree, minimizing diffs (even indentation!) is a necessary evil. Nowadays I will use lambdas that return early in preference to goto. Not from fastidiousness so much as to avoid confusing the optimizer. Poster child for reprehensible use of goto is procmail.