3 ms·
Why wish the world to be more complicated by insisting a character do double duty both as a valid character in file names and also a delimiter in lists of file
by skissane 3y ago
Why wish the world to be more complicated by insisting a character do double duty both as a valid character in file names and also a delimiter in lists of file names, such as commonly occur in command line arguments?
By allowing a character to do double duty in that way, you make necessary all the complexity of quoting/escaping.
If the set of file name characters, and the set of file name delimiters, are orthogonal, you reduce (possibly even eliminate) the need for that complexity.
Also, allowing space in filenames creates other difficulties, such as file names with trailing spaces, double spaces, etc, which might not be noticed, even two files whose names differ only in the number of spaces.
A character like underscore does not have the same problem, since a trailing underscore or a double underscore is more readily recognised than a trailing or double space.
- eviks 3y agoBecause the land of cli args is inconsequential compared in scale compared to the general world of computer use (so it's better to wish for a tiny segment to have better design), and banning spaces does not remove the complexity of escaping (how do you escape _?) Your trailing/double space issue is also easy to solve (in the world of wishes) with highlighting or other mechanisms, so making the world much worse by banning spaces is not the appropriate remedy
- samatman 3y agoI've never used a filesystem which doesn't remove trailing spaces from file names. Try it.
- skissane 3y agoI’ve never seen a filesystem which removes trailing spaces from file names. I take it you are talking about GUIs which do that, not filesystems.
- skissane 3y ago> Because the land of cli args is inconsequential compared in scale compared to the general world of computer use Not really true - the “general world of computer use” uses that stuff very heavily, just “behind the scenes” so the average user isn’t aware of it. For example, it is very common for GUI apps to parse command line arguments at startup (since, e.g., one way the OS, and other apps which integrate with it, uses to get your word processor to open a particular document, is to pass the path to the document as a command line argument) > and banning spaces does not remove the complexity of escaping (how do you escape _?) You don’t need to escape _ unless it has some special meaning to the command processor/shell. On Unix it doesn’t. Nor for Windows cmd.exe
- eviks 3y ago> just “behind the scenes” That means they're not using it since they don't have to deal with spaces as spaces vs as separators > You don’t need to escape So how do you differentiate between a user inserting a space and a user inserting a literal _ in a file name?
- skissane 3y ago> That means they're not using it since they don't have to deal with spaces as spaces vs as separators The end-user isn't consciously using it. The software they are using is. We are talking here about programmer-visible reality, not end-user-visible reality. Those two realities don't have to be the same, as in the "replace spaces with underscores and vice versa" idea. > So how do you differentiate between a user inserting a space and a user inserting a literal _ in a file name? Underscores are rarely used by non-technical users. It isn't a standard punctuation mark. Back when people used typewriters, the average person was familiar with using them to underline things, but nowadays, the majority of the population are too young to have ever used one. I doubt many non-technical users would even notice if underscores in file names were (from their perspective) automatically converted to spaces, since they probably wouldn't put one in to begin with.
- eviks 3y ago