Date: Tue, 07 Jan 2025 18:51:35 +0300
On January 7, 2025 4:55:15 AM Ville Voutilainen via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> On Tue, 7 Jan 2025 at 03:35, Hyman Rosen via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>>
>> Attaching labels to do/for/while/switch statements and having gotos target
>> them is already legal in C and C++. If someone needs that construct, they
>> can already use it whether the would-be masters of C++ style like it or
>> not. So the argument against using those labels for break/continue seems to
>> be that programmers would not normally write such gotos, but once they
>> attach the labels, the temptation will be so overwhelming that they won't
>> be able to help themselves. Which ... I can't even.
>
> That's not the argument. The argument is that if you happen to have
> gotos in your code, and I happen to have labeled loops in the same
> code, I don't
> have to consider my labeled loops as possible targets of your
> spaghetti jumps, because they can't be. I don't need to include them
> in my search for
> the possible targets of your spaghetti jumps.
Labels' scope is limited to the enclosing function. Any developer editing a
function is expected to at least look through the function body before
making his modifications. I don't believe name clashing within the function
body is a big problem that is difficult to avoid.
<std-proposals_at_[hidden]> wrote:
> On Tue, 7 Jan 2025 at 03:35, Hyman Rosen via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>>
>> Attaching labels to do/for/while/switch statements and having gotos target
>> them is already legal in C and C++. If someone needs that construct, they
>> can already use it whether the would-be masters of C++ style like it or
>> not. So the argument against using those labels for break/continue seems to
>> be that programmers would not normally write such gotos, but once they
>> attach the labels, the temptation will be so overwhelming that they won't
>> be able to help themselves. Which ... I can't even.
>
> That's not the argument. The argument is that if you happen to have
> gotos in your code, and I happen to have labeled loops in the same
> code, I don't
> have to consider my labeled loops as possible targets of your
> spaghetti jumps, because they can't be. I don't need to include them
> in my search for
> the possible targets of your spaghetti jumps.
Labels' scope is limited to the enclosing function. Any developer editing a
function is expected to at least look through the function body before
making his modifications. I don't believe name clashing within the function
body is a big problem that is difficult to avoid.
Received on 2025-01-07 15:51:42