Why Does Windows Use Backslash as Path Separator? (2019)
os2museum.com
os2museum.com
It is true that the CP/M operating system itself did not use the forward slash, but the only reason for that was that the operating system included only a handful of executable programs, the main being the equivalents of the later "COMMAND.COM", "DEBUG.COM" and "COPY.COM" of Microsoft.
The very few executable programs provided with the OS did not have any command-line options. A few of the most common file operations were shell built-ins, not separate executable programs.
On the other hand, most CP/M executable programs (which were bought from third parties, not from Digital Research, the vendor of CP/M) had command-line options and, without exceptions, they used the forward slash for command-line options, instead of the hyphen used by UNIX.
It would have been absolutely impossible to use CP/M without being aware of the convention that the forward slash is used for the command-line options.
The article is completely correct that the use of the forward slash for options was not introduced by CP/M, but it was taken from the operating systems of the DEC Corp., which, during the seventies, were much more widely used than UNIX, which was an alternative for them only on PDP-11, and it was not yet used much outside the Bell Labs.
Nevertheless, all the programs ported to MS-DOS 1.0 (e.g. MS BASIC, Turbo Pascal, WordStar, dBASE and so on) had not been ported from programs written for DEC OSes, but from programs written for CP/M.
There is no doubt that the forward slash of MS-DOS 1.0 is directly inherited from CP/M. It was used by the same programs, for exactly the same options, so they must have kept the command-line parser without changes. I have used many of the same programs both first for CP/M and then for MS-DOS, so I can be certain about this.
I have also used the DEC RSX-11M operating system on PDP-11, and indeed the RSX-11M utilities, for example PIP (Peripheral Interchange Program, a file transfer program with many options, somewhat like UNIX dd), used the forward slash many years before CP/M and most programmers for CP/M should have been familiar with this convention, so they have reused it, but the relationship from DEC OSes to MS-DOS 1.0 is indirect, via CP/M.
PIP was part of CP/M – it was an external executable rather than a command processor builtin, what in MS-DOS terminology is called an "external command", in CP/M terminology a "transient command" – and PIP did have command line options. It didn't use either hyphen or forward slash, instead it put switches (which it called "parameters") in square brackets, for example:
PIP LPT:=X.ASM[NT8U]
Prints the X.ASM file on the LPT: device (line printer). Option "N" means line add line numbers, "T8" means expand tabs at every 8th position, and "U" means convert lowercase to uppercase. [0]
This is different syntax from DEC operating systems, such as RSX-11M [1] or OS/8 [2], where PIP indeed used slash as an option character.
This "switches in square brackets" convention was used by other commands as well, for example the LINK linker [3]. This convention is (obviously to me) influenced by the IBM CMS mainframe operating system, [4] albeit with the parentheses of CMS replaced by square brackets. We know Gary Kildall used CMS at the Naval Postgraduate School, and it also (I'd say) influenced CP/M's use of drive letters A-Z (as in CMS file modes) instead of the multi-character disk device names generally used by DEC operating systems.
Square brackets is CP/M's native convention for command line switches. Forward slash is something not native to CP/M, but a convention spread by certain ISVs. I think the linked blog post is likely right that Microsoft introduced this convention in its products, and I'd say it likely spread to other ISVs due to the widespread adoption of Microsoft's development tools. The fact that many larger ISVs used DEC minicomputers as a cross-development platform, not just Microsoft, was likely also a factor. While IBM mainframes influenced Kildall personally, and through him CP/M, IBM mainframes were much less likely to be used by CP/M ISVs than DEC minicomputers, because they were a lot more expensive.
[0] http://www.tramm.li/i8080/cpm22-m.pdf page 1-33 (PDF page 40)
[1] http://www.bitsavers.org/www.computer.museum.uq.edu.au/RSX/A... page 5-2 (PDF page 70)
[2] https://www.grc.com/pdp-8/docs/OS8_System_Reference_Manual.p... page 65 (PDF page 73)
[3] http://bitsavers.org/pdf/digitalResearch/cpm_plus/CPM-Plus_U... page 83 (PDF page 96)
[4] see for example https://www-40.ibm.com/servers/resourcelink/svc0302a.nsf/pag... page 42 (PDF page 66)
It was only ever at the UI (command prompt), and in how some programs converted inputs and outputs where '\' was necessary, as the knowledge about '/' being usable wasn't all that widespread.
What used to peeve me was C source on DOS development environments with lines like:
#include "path\\to\\file.h"
When the following always seemed to work (with the compilers I used): #include "path/to/file.h"
Or at least it did with Borland compilers.cd \D <-- This takes you to the C:\D\ directory.
cd /D <-- This is an error because /D is a flag.
It should, as you said, not work for normal applications
But in this case, I don't think it matters.
And BTW .reg files need to double the backslash because it is parsed as an escape character.
CP/M borrowed most of its structure from RT-11 and also didn't have directories, just devices. The filename format was 8.3 instead of 6.3.
MS-DOS in 2.0 (which introduced directories) defaulted to using the forward slash as the command options separator, but had an option in CONFIG.SYS for SWITCHAR that if you set to something other than forward slash, allowed you to use the forward slash as a directory separator.
False, or perhaps only true for "Windows NT" before Dave Cutler and his team developed it while working for Digital. After Cutler arrived at Microsoft and took over development of NT there (i.e. replaced it with the OS he developed at DEC at... not sure NT 4.x? ), Windows NT was no longer derived from DOS, rather, DOS was ported to Cutler's OS. The last OS derived from or based on DOS may have been Windows ME.
I say allegedly because this was just passed around as sort of 'common knowledge' in OS/2 community groups back in the late 90's. I've never seen it actually verified.
That's weird way to put it, kernel was swapped but Win32 was designed to be mostly source compatible with Win16. (and it was available both on WinNT and Win9x)
The exception is if the multiple slashes appear at the beginning of the path. Windows accepts UNC paths which begin with double slashes. It will not normalize multiple slashes into double slashes at the beginning of a path but any following multiple slashes will be normalized to a single slash.
It is the only optionally typed language in common use whose types are checked at runtime.
Or:
Its type system has notation for 'the concrete type of `this`', what Rust calls `Self`, and no OO language in common use other than Swift has.
It's actually pretty easy to find something nice about PHP.
The type system also does apparently not provide a common Object kind of type. So Object cannot be used to work around the lack of generics. Making it difficult (impossible?) to create abstract data structures and making sure, that the functions for that ADT only accept things that adhere to some interface. This makes the type system rather less useful in general.
I guess it all stems from the earlier days of PHP, where OOP was added badly and in hindsight. It still shows.
There is a common type, `mixed`. A common superclass fills that role in some OO languages, and not in others. The practical purpose of a common superclass is to provide builtin functions like C#'s object.ToString(). You don't need to do that when working with generics, and __toString is a magic function instead. So `mixed` fills that role perfectly fine.
The more I've shifted towards a keyboard-centric workflow, the more I'm feeling this lack of consideration regarding non-US layouts. When using a Spanish keyboard, the placement of characters like forward slashes, backslashes, tildes, pipes, etc. can be physically painful after an extended typing session. I'm considering either getting a US keyboard, or doing some serious keyboard map tweaking.
It's somewhat amusing to think that my current ergonomic predicaments are essentially the result of operating system and keyboard design choices and conventions that are over half a century old at this point.
Suddenly all those key bindings and symbols made sense, or at least were somewhat reachable without contorting my hands. I never noticed how terrible DE keyboards are for programming before but I don't want to go back.
https://retrocomputing.stackexchange.com/questions/17069/why...
Paths were, and to a certain extent still are, not readily visible on Macs.