In any CASE, it is somewhat INSENSITIVE to point out to someone how well PRESERVED they are

by Michael S. Kaplan, published on 2007/06/13 21:56 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2007/06/13/3280569.aspx


There are two concepts that, while related, are not completely equivalent.

In fact, one could not even technically be considered a subset of the other (although in fairness I will point out that some of the times where one is not a subset of the other, it tends to point to either a bug or more likely a design flaw!).

The concepts are simple: case preserving vs. case sensitive, as applies to software components (and the applications/platforms that use them).

A component can be said to be case preserving if it remembers the distinctive nature of the data it is given, specifically in the case used.

A component can be said to be case sensitive if it considers the two case variants of letters to be separate letters (and contrariwise can be said to case insensitive if those two case variants of letters are treated as if they were the same).

Now Windows, in its object namespaces and its NTFS file system and other places, can be said to be case insensitive and case preserving, because it will remember that you saved the filename as AbCdEfGhIjKlMnOpQrStUvWxYz.txt, even thought it will not allow aBcDeFgHiJkLmNoPqRsTuVwXyZ.txt to be saved in the same directory.

So, the way it breaks down in the real world....

If you are case sensitive then you really have to be case preserving -- otherwise you claim the distinction is important even though you don't always remember the distinction. That is kind of the world where components that are case sensitive mix with the ones that are case insensitive -- like C++ COM components dealing with VB.

If you are case insensitive then you don't have to be case preserving, but it is probably better if you were (otherwise a user could be kind of annoyed to see the case switched on them in some way). This is (to use a VBA/VB example again) the kind of problem that happens where something like a name map is kept that forces all variants of  string ti be cased only one way, even if they are not in any kind of conflict with each other. Another bad user experience.

A good rules summary:

1) you should always preserve.

2) In fact you must preserve if you are sensitive.

3) You should never assume that someone else will follow any of these rules. Because people suck at rules.

Simple, right? :-)

you may see some good and bad examples of this in upcoming posts. Or feel free to share your own here....

 

This post brought to you by ڡ (U+06a1, a.k.a. ARABIC LETTER DOTLESS FEH)


# Wilhelm Svenselius on 14 Jun 2007 1:27 AM:

Sorry to nitpick, but you spelled INSENSITIVE wrong in the title.

# Michael S. Kaplan on 14 Jun 2007 2:23 AM:

Oops! Sorry 'bout that. :-)

# Mike on 14 Jun 2007 12:46 PM:

Wasn't DOS case insensitive but not case preserving?  I seem to remember it always saved filenames as upper case.

# Michael S. Kaplan on 14 Jun 2007 1:08 PM:

Indeed it was! And in fact short names still are (well, sometimes). I should probably blog about that, too!

# Mike on 15 Jun 2007 10:58 AM:

I have a little peeve about Microsoft apps that uppercase file extensions when they interact with your files.


Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2007/10/24 Getting the preserved case of a file wHeN tHe uSeRs tYpE wHaTeVeR tHe hElL tHeY wAnT tO

2007/10/24 In Case you have problems that you might think are ǸȦȘȚȲ

2007/10/02 What happens when people don't consistently preserve case? They cause bugs!

2007/09/05 Head checks containing either comparison or case validation BITE

2007/08/21 In Case there is a bug....

2007/06/18 If you don't always preserve case, you don't always preserve meaning

go to newer or older post, or back to index or month or day