Re: The case insensitive #include statement horror...



William DePalo [MVP VC++] wrote:

Seriously, what irks me about posts like the OP's, is that what underlies
his question is that there is some a priori reason why Windows should
behave like 'nix, 'nux and 'pux. There is not.

That was not my intention, you misunderstood me there. Although I do not
like the case-insensitivity of the Windows file system, I can accept it (my
preferences are possibly caused by my affinity to good literature and the
german language, where case really makes a difference...).

What I want is not Windows to behave like Unix alikes, instead I want the
programmers follows the programming style guide rules. If you develop cross
platform, you come much faster to a stable state of the source, if
programmers do think about what they write carefully. "Works for me" is not
a good argument for good code - okay following a style guide isn't neither,
if the SG isn't good. But ours is, I think.

Looking for the option he wants would be like asking to turn off the file
system's case sensitivity on his favored platform.

No, it's more like asking the programmer switching case sensitivity in their
mind on.

But for the life of me, I can't figure out why it would be a good thing
for the file system to allow the existence of two distinct files foo.h and
Foo.h, for example.

It enlarges the namespace of possible filenames... ;-) Serious: The naming
of the files can make a difference. For example many style guides define
upper case at word boundaries to make longer variable or filenames better
readable and less ambiguous. If there really were no reason to have upper
and lower case in filenames, one might wonder, why every OS has them. E.g
Microsoft could have decided not to implement a case conceiving file
system, since case makes no difference for the computer anyway. But for the
human eye and for understanding, what names mean, it makes a difference.

Chances are the reason is historic and goes back to
the times when the o/s designers feared the machines of the day didn't
have the horsepower for the case insensitive compares.

I don't believe that, but it would be interesting to know the real reason. I
suspect, that it has something to do with data consistency. Ignoring case
in filenames leads to unnoticed change of data, which is one thing, most
users and system operators won't like very much. As far as I can remember,
old Unix filesystems worked such, that directories were files itself. These
special (but normal text-)files just contained the names of the files,
which were in that directory. You were able to edit this file by hand to
move file around or rename them. Since text in a text file definitely must
be case sensitive (I think, we can agree on that?), the filenames in old
Unix filesystems must also be case sensitive. I don't know, if that is the
whole story, but I think, it explains pretty much.

Regards
Stephan

.



Relevant Pages