views:

89

answers:

2

I recently rolled an application that automatically encrypted a file output from another internal system using PGP and then sftp’d to a foreign target server directory where it was to be consumed by a third-party application. I have been trying to trouble shoot the whole process for about a week and was getting no response from the third-party until this morning in an email....

Turns out, the file is named incorrectly so the system didn’t think you submitted it. There was a capital “T” that should have been lower cased.

Ok. After an aggravated sigh (since nobody else has access to that directory and no other files named in a similar fashion), I started to wonder, “When should an application honor case sensitivity from user input outside of passwords?” I am running through my brain here trying to think of a time when I would want "fileName" and "FileName" to mean something different intentionally.

I am not talking about in-application variable naming conventions here, btw. I'm actually very much for case-sensitive in-language.

+2  A: 

I suppose it would depend on what platform it is on. In Linux case sensitivity is the default so that would bring case sensitivity to the file system calls nessacary to find a file in a directory. But other than that it shouldn't.

Jeremy Reagan
It might be a default, but would you ever construct a system in Linux from scratch that did? I guess I am trying to find a possible motive or use case here. If there isn't one, that's fine too. I just want to ask the collective before passing judgment. :)
Ian Patrick Hughes
I guess that is kinda the point, I'm not a linux developer but in Windows it is a case in-sensitive call because the file system is case in-sensitive. So I imagine the reverse is true of linux. So I don't think you would have much choise in the matter without rolling your own.
Jeremy Reagan
+1  A: 

You'd want to preserve case whenever:

  • The input is displayed back to a user who expects to see it exactly as entered.

  • Upper- and lowercase letters have different intrinsic meaning, e.g. "kb" (1000 bits) vs KB" (1024 bytes).

  • The data may be processed case-sensitively external to your application, as in your problem statement.

  • The data will be stored but not "processed" (searched, sorted, compared) so there is no need for normalization.

Adam Liss