Live data from Hacker News

Why is the DOS path character "\"?

blogs.msdn.com

11–20 of 68 posts

Re: Why is the DOS path character "\"?

#11
post #2

This article remind me of my first days of C coding and the problems generated with escaped "c:\haracters in strings". After years I still think that the use of forward slash is the worst decision ever. At least Apple chose ":" on Mac OS classic.

Fortunately today you can use string literals with most programming languages.

Re: Why is the DOS path character "\"?

#12
post #8

Earlier quoted context omitted.

If you're referring to \ it's a backslash not a forward slash.

A simple way to remember forward/backslash (which I probably read on HN) is the phrase "Backslash is by the backspace" Edit: This is for the standard US keyboard. A more general way of thinking about it, though a bit more to remember: associate "positive" with "forward", and see that '/' has a positive slope. Or just go listen to a BBC podcast, and let the sound of the broadcaster saying "bbc dot co dot uk forward-sl…

But it isn't by the backspace... in fact it's almost the furthest from it! Probably depends on your keyboard layout though.

Re: Why is the DOS path character "\"?

#13
post #8

Earlier quoted context omitted.

If you're referring to \ it's a backslash not a forward slash.

A simple way to remember forward/backslash (which I probably read on HN) is the phrase "Backslash is by the backspace" Edit: This is for the standard US keyboard. A more general way of thinking about it, though a bit more to remember: associate "positive" with "forward", and see that '/' has a positive slope. Or just go listen to a BBC podcast, and let the sound of the broadcaster saying "bbc dot co dot uk forward-sl…

Reminds me of many discussions I would have explaining how to invoke a particular DOS command to people whose MO was "dir" and then violently mashing to allow themselves to page through a large directory.

"File slash" and "option slash" were far less confusing than decoding the secretary's concept of "forward" and "back."

Re: Why is the DOS path character "\"?

#14
Interestingly, if you ever come to Japan you will find many people expect path separators to be yen symbols (¥). Their windows paths look like:

¥docs¥finance¥

To understand the reason, just check out the table on the Shift-JIS encoding:

http://en.wikipedia.org/wiki/Shift_JIS

Specifically, look at the character at 0x5C where the backslash sits in ASCII. Learning this was one of those mind-blowing moments when you try to imagine what a world where that was normal would be like.

Re: Why is the DOS path character "\"?

#15
post #8

Earlier quoted context omitted.

If you're referring to \ it's a backslash not a forward slash.

A simple way to remember forward/backslash (which I probably read on HN) is the phrase "Backslash is by the backspace" Edit: This is for the standard US keyboard. A more general way of thinking about it, though a bit more to remember: associate "positive" with "forward", and see that '/' has a positive slope. Or just go listen to a BBC podcast, and let the sound of the broadcaster saying "bbc dot co dot uk forward-sl…

On a UK keyboard, it's by left shift, making slash closer to backspace.

Re: Why is the DOS path character "\"?

#16
post #8

Earlier quoted context omitted.

If you're referring to \ it's a backslash not a forward slash.

A simple way to remember forward/backslash (which I probably read on HN) is the phrase "Backslash is by the backspace" Edit: This is for the standard US keyboard. A more general way of thinking about it, though a bit more to remember: associate "positive" with "forward", and see that '/' has a positive slope. Or just go listen to a BBC podcast, and let the sound of the broadcaster saying "bbc dot co dot uk forward-sl…

Backslash is near L-Ctrl on my keyboard. Forward slash is far closer to backspace.

Perhaps a better way would be to think (for L-to-R language users) of the charater toppling "forwards" / or "backwards" \ WRT the text direction.

Re: Why is the DOS path character "\"?

#17
post #14

Interestingly, if you ever come to Japan you will find many people expect path separators to be yen symbols (¥). Their windows paths look like: ¥docs¥finance¥ To understand the reason, just check out the table on the Shift-JIS encoding: http://en.wikipedia.org/wiki/Shift_JIS Specifically, look at the character at 0x5C where the backslash sits in ASCII. Learning this was one of those mind-blowing moments when you try…

Interesting! I wonder why they changed that particular character and not one that is literally everywhere in DOS.

Using ¥ as backslash still works in Windows and legacy apps (in OSX option+¥ gives a "real" \.)

This leads to some interesting situations: Word documents filled with ¥ where there should be \ and vice versa. By interesting I mean extremely annoying.

Another caveat is that anything hardcoded to use the tilde ~ will probably break because it is mapped to a completely key on Japanese keyboards. This causes endless fun in DOSBOX or even newer games: to get the console in Doom 3 I had to edit the source and recompile it with the console key mapped to another character.

Re: Why is the DOS path character "\"?

#18
post #14

Interestingly, if you ever come to Japan you will find many people expect path separators to be yen symbols (¥). Their windows paths look like: ¥docs¥finance¥ To understand the reason, just check out the table on the Shift-JIS encoding: http://en.wikipedia.org/wiki/Shift_JIS Specifically, look at the character at 0x5C where the backslash sits in ASCII. Learning this was one of those mind-blowing moments when you try…

Interesting! I wonder why they changed that particular character and not one that is literally everywhere in DOS. Using ¥ as backslash still works in Windows and legacy apps (in OSX option+¥ gives a "real" \.) This leads to some interesting situations: Word documents filled with ¥ where there should be \ and vice versa. By interesting I mean extremely annoying. Another caveat is that anything hardcoded to use the til…

Several positions in the table ({ | } [ \ ] @) were meant for "national variants". I guess those characters were deemed unimportant at the time.

Here is some more info: http://www.cs.tut.fi/~jkorpela/chars.html#national-ascii

Re: Why is the DOS path character "\"?

#19
post #14

Interestingly, if you ever come to Japan you will find many people expect path separators to be yen symbols (¥). Their windows paths look like: ¥docs¥finance¥ To understand the reason, just check out the table on the Shift-JIS encoding: http://en.wikipedia.org/wiki/Shift_JIS Specifically, look at the character at 0x5C where the backslash sits in ASCII. Learning this was one of those mind-blowing moments when you try…

Interesting! I wonder why they changed that particular character and not one that is literally everywhere in DOS. Using ¥ as backslash still works in Windows and legacy apps (in OSX option+¥ gives a "real" \.) This leads to some interesting situations: Word documents filled with ¥ where there should be \ and vice versa. By interesting I mean extremely annoying. Another caveat is that anything hardcoded to use the til…

I wonder why they changed that particular character and not one that is literally everywhere in DOS.

I've wondered about that as well. My guess is that they looked at it and thought 'who needs two kinds of slash anyway?' I would love to know the actual thought behind that choice.

Re: Why is the DOS path character "\"?

#20
post #18

Earlier quoted context omitted.

Interesting! I wonder why they changed that particular character and not one that is literally everywhere in DOS. Using ¥ as backslash still works in Windows and legacy apps (in OSX option+¥ gives a "real" \.) This leads to some interesting situations: Word documents filled with ¥ where there should be \ and vice versa. By interesting I mean extremely annoying. Another caveat is that anything hardcoded to use the til…

Several positions in the table ({ | } [ \ ] @) were meant for "national variants". I guess those characters were deemed unimportant at the time. Here is some more info: http://www.cs.tut.fi/~jkorpela/chars.html#national-ascii

Thus, the characters that appear in those positions - including those in US-ASCII - are somewhat "unsafe" in international data transfer

...

Systems that support ISO Latin 1 in principle may still reflect the use of national variants of ASCII in some details; for example, an ASCII character might get printed or displayed according to some national variant. Thus, even "plain ASCII text" is thereby not always portable from one system or application to another.

That's awesome! Hard to believe that systems have worked as well as they have. It's pretty obvious nobody was expecting that one day all computers would have to read each other's data pretty much constantly.

So I guess the question is: why did the DOS developers pick the character that happens to vary from region to region? I guess they didn't know?

Post reply on HN