Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've always felt the better question is "Why is the UNIX path character "/"?

People use "/" as a date separator as in 12/25/1979 so effectively banning that character as a character in filenames seems a really poor choices. By that metric chosing "\" is a much better choice because "\" is used no where I know outside of computers. I've never encountered it anywhere outside of computers so arguable it's the perfect choice for a path character.



> I've always felt the better question is "Why is the UNIX path character "/"?

Just a guess, but it's probably because \ is used for character escapes in C (and the Bourne shell). Given that the history of Unix is inextricably tied to C, it kind of makes sense to use / over \ so you don't have to do lots of \\ to escape path names.


Other people use '.' in dates. Or '-'. Especially the latter would end up with the same problem: Why is - and -- used as a switch character if it is used in dates (and even quite common in normal text, names)?

And given that the history of '\' as a path separator is that long, maybe you haven't seen in elsewhere _because_ it is now forever taken for the world's most popular OS?


Why is - and -- used as a switch character if it is used in dates (and even quite common in normal text, names)

Those uses rarely have it next to whitespace, and almost never immediately after whitespace.

If someone’s named Jean-Claude, it is not customary to refer to them as -Claude for short, and if I refer to items dated 2012-03-19 and 2012-03-20, it is not customary to call one of them -20.

But that last example shows something that Unixy switches do conflict with: negative numbers.


Well responded.

Two (not entirely serious) counterarguments:

- Lists like this

- Abusing the char as em-dash

- Weird languages. In German it's quite common to use that character to shorten the monster words. Pulling samples from my reared (note the disclaimer about being not to serious)

  Lebens- und Krankenversicherung
  (Shorthand for Lebensversicherung und Krankenversicherung) 
The inverse is possible, but less common as far as I am aware

  Arbeitsplatz und -Umfeld
  (Arbeitsplatz und Arbeitsumfeld?) 
Looks ugly to me and the samples are pre-coffee, but this is definitely possible.


All good points. I would say that lists like that are also abuse; the hyphens there ought to be · or something similar. But it certainly appears in the wild. (Similarly, in formal contexts, the negative sign is − and not -, but very few people care.)

The last usage is also possible in English. A construction like “face-huggers and -eaters” is rare but not outlandish.


Of course, Windows bans the use of both / and \ (along with : and other useful things) in filenames anyway so you still can't enter dates in that format. I guess back when they made the decision on the path separator the max path length in DOS was so short it may not have seemed relevant.


It seems from http://cm.bell-labs.com/who/dmr/hist.html that Multics used > as the path separator. Unix decided to use < and > for redirection (in the PDP7 era), so something else was chosen for pathnames when they were introduced later on the PDP11.


This is a good thing though since this encourages more people to use the ISO date formats. They are unambiguous, easy to parse and sort correctly


There are other uses of the slash character. It's a poor choice.

_ or | get my vote, but it's a bit late now to fix the mistakes of the past. There are enough special chars needed anyway that collisions are inevitable.

At least they didn't pick 'E'.


The problem with those characters is that they require you to hold shift to type them on a standard keyboard. Also, they make you reach in a way that / doesn't (now I'm showing my pro-/ bias).


On which standard keyboard?

Each country has a different layout, are you aware of it?

In most European countries both types of slash require two key presses.


In addition to the other reasons listed here,

/ is easier to type than \


On which country?



I have reading comprehension issues, because if I count correctly almost all layouts require AltGr or Shift to obtain \ or /.

But hey that is just me.


Put those into the tie category.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: