That's not a good reason. This kind of things are best to be left to the discretion of the programmer.
By the same reasoning we should only be able to declare local variables at the start of a function. But that's not the case. That's the very same issue, I don't see why a different rationale should apply.
In the early days, a lot of programming languages mandated to have local variables all declared at the start of a function. And a lot of people thought it was better that way, more "organized". Until finally most people realized the benefits of locality: a local variable, used locally (doh) should be declared as close as possible to its use. Hence the change regarding this rule from C to C++.
And my question is more about a good "technical" reason.
By the same reasoning we should only be able to declare local variables at the start of a function. But that's not the case. That's the very same issue, I don't see why a different rationale should apply.
In the early days, a lot of programming languages mandated to have local variables all declared at the start of a function. And a lot of people thought it was better that way, more "organized". Until finally most people realized the benefits of locality: a local variable, used locally (doh) should be declared as close as possible to its use. Hence the change regarding this rule from C to C++.
And my question is more about a good "technical" reason.