chrishoffman at February 10th, 2014 04:04 — #1
Originally published at: http://www.howtogeek.com/181774/why-windows-uses-backslashes-and-everything-else-uses-forward-slashes/
Have you ever noticed that it’s C:\Windows\ in Windows, http://howtogeek.com/
on the web, and /home/user/ on Linux, OS X, and Android? Windows uses backslashes for paths, while everything else seems to use forward slashes.
nsdcars5 at February 10th, 2014 04:36 — #2
Note: Android doesn't have /home; it has /data, /sdcard, and sometimes /ext_card or /external_sd.
meoow at February 10th, 2014 09:31 — #3
Windows' backslash matters when you do programming. Say a string "d:\new\day" which you think it is a path but most programming languages see it as a totally different thing, especially when regular expression involved. You have to use double backslash to get one literal backslash.
The design of windows is so freaking stupid.
wilsontp at February 10th, 2014 11:37 — #4
It's not stupid at all. The decision makes perfect sense, considering the choice of using the slash as the "switch" flag in command-line programs.
And it's not like the slash was a universal directory separator, either. When MacOS was introduced, it used the colon character.
DOS and Windows have gone through a lot of changes over the years, but I wouldn't call its design any more stupid or chaotic than its only competitor these days, Unix and its children. How many command shells does Unix have these days? csh, bash, ksh.... and then there are all the different flavors: AIX, BSD, Linux (with its own gazillion breeds), and MacOS.
And MacOS discarded X-Window completely in favor of a new graphical environment. So proper Unix programs, even after being compiled from source, still need to be ported to work properly on the Mac without needing a separate X server to fire up.
yeah, Windows is the one with the problem.
damian at February 10th, 2014 12:17 — #5
Forward slash? Geek twitch!
wilsontp at February 10th, 2014 17:38 — #6
Right... the term is "slash". There's no such thing as a "forward slash."
marvin_robertss at February 10th, 2014 17:50 — #7
We could go with the OpenVMS file structure and use periods as the directory level delimiter.
See, with periods you don't have to worry about using the regular character (slash) or the back one (backslash).
tsoderlu at February 13th, 2014 06:24 — #8
Actually, Firefox FAILS horribly at translating http:\\howtogeek.com\ (for some reason this you have to write three backslashes to make it show two here in this commenting section) to http://www.howtogeek.com/ and instead transforms it to http://www.//howtogeek.com/. Dunno if it works with Crome but with IE 11 it works, imagine that.
nsdcars5 at February 13th, 2014 10:05 — #9
Chrome has an "h" in it. Sorry, couldn't resist.
Chrome is okay - http:\windows.com turns to http://windows.com (which then turns to http://windows.microsoft.com, but that's not important).
system at February 20th, 2014 04:04 — #10
This topic was automatically closed after 10 days. New replies are no longer allowed.