What technical reasons exist for not using space characters in file names

file managementfilenamesoperating systems

Somebody I know expressed irritation today regarding those of us who tend not to use spaces in our filenames, e.g. NamingThingsLikeThis.txt — despite most modern operating systems supporting spaces in filenames.

Are there technical reasons that it's still common to see file names without (appropriate) spaces? If so, what are these technical reasons that spaces in filenames are avoided or discouraged, and in what circumstances are they relevant?

The most obvious reason I could think of, and why I typically avoid it, are the extra quotes required on the command line when dealing with such files. Are there any other significant technical reasons?

Best Answer

Whitespace characters in filenames can be a right royal pain in the proverbial in many contexts on the command line, and in scripts, where you have to be careful to make sure they are properly escaped so don't look like separators to the commands you are running.

It is just safer not to have them there, even if you are sure the file/dir/what-ever is never going to be used in such a context.

That, and old habits die hard.

Related Question