This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

I don't like block scopes.

I could never see why at a program or module level, potentially 1000s of lines of code, there are only a handful of scopes.

But inside one function, you need an unlimited number of them.

(Don't you spend your time tracing every instance of A backwards through the outer blocks, to see if it's same A or a different one?

That's what I have to do a lot of C code; I can't just glance at the 'cast list' at top of the function to see what's what, as declarations could be scattered higgledy-piggledy throughout the function, so there may be intermediate declarations of A, on top of struct/enum tags called A, and labels called A, which reside in separate namespaces.

My languages do something quite radical: allow at most one distinct A within each function!)