It has been brought up groups about C and Modula2 languages, which are case insensitive. They often already have warnings for such cases. (but since it is legal per language spec, it IS allowed).
Warnings? In Java, not only that no warnings are issued, but naming object the same as class, only with lower case, is actually very usual. I think that is their horrible convention:
// In Java code, this is very usual:
Have you thought about this?
For Pascal it is irrelevant, since Pascal ignores case.
Hm... yes, it's irrelevant now for Pascal, since it ignores case. It is irrelevant now for C, as it does not.
It is irrelevant for Pascal, for C, for Java,... because these languages took their ways long time ago.
I am just questioning why they took one way or the other, while I think the mix, which none of these took would be the cleanest.
Isn't this the most error-preventing by its nature?
In case insensitive languages such errors can't happen. You can of course redeclare anything in a different scope, but that is not related to casing.
In case-insensitive language you are allowed to do this:
var
AVariable: Integer;
begin
aVaRiaBLe := 3;
end;
Not very nice. If it were forbidden, the code readability would be better.
So, it seems a bit strange that no language took this third way.
You can of course redeclare anything in a different scope, but that is not related to casing.
Of course I am talking about same scope.