5 ms·
I find these sort of articles so very tiring... I realize this is from the OS/2 Museum and not Microsoft - but the result is the same: Article written about a
by Alupis 3y ago
I find these sort of articles so very tiring...
I realize this is from the OS/2 Museum and not Microsoft - but the result is the same:
Article written about a poor engineering decision made decades ago, which for reasons that perplex everyone still live-on today. Then the Microsoft apologists come out of the woodwork to explain how easy it is to live with these poor engineering decisions and how smart Microsoft Engineers are, and how it's literally all other operating systems that somehow are lacking, blah blah blah.
Backwards compatibility is usually the smoke screen apologists deploy during these discussions. As-if in the past few decades Microsoft couldn't have written a simple '\' -> '/' converter... Hell, if you look in the Explorer address bar, Microsoft even hides the path separator - opting to replace it with arrows instead.
Let's not even start on the CRLF thing...
Yes, Windows owes it's origin to OS/2, and OS/2 used '\' instead of '/' - so we should never correct a decision inherited from an OS that died 22 years ago...
- asveikau 3y agoWith respect, what the hell are you talking about? Win32 file APIs can actually use either '/' or '\\' as a path separator. The stuff this is talking about is mostly around DOS command line tools and the successor, cmd.exe, which yes is mostly meant to run scripts written for DOS. '\\' was selected by DOS, specifically DOS 2.0 per TFA, several years before OS/2 existed.
- Alupis 3y agoWhen you open Explorer and click in the address bar - what path separator is displayed? How about when you install software - what path separator does it show? > Win32 file APIs can actually use either '/' or '\\' as a path separator. Fantastic - so why are we still entertaining this idiotic file separator everywhere within the OS itself? > '\\' was selected by DOS, specifically DOS 2.0 per TFA, before OS/2 existed Fine - so why the hell are we still doing things like a dead, defunct OS did and literally nobody else did because, you know, it was unintelligent?
- asveikau 3y ago> Fantastic - so why are we still entertaining this idiotic file separator everywhere within the OS itself? Dude, why are you so angry about what direction a slash goes? Once they introduced the ability to use either one, they still had a lot of software that hardcoded '\\', including lots of their own. Again, they support either one in most places. The backslash is considered more canonical because it came first. Going back to DOS for a second, TFA even says Microsoft wanted to use '/' in DOS 2.0 when they introduced directories (1983), but IBM objected.
- Alupis 3y agoIBM objected in 1983 - yet that decision lives on today? It's what Windows displays to users, even if you can actually type in / and things still work. When Microsoft wrote IIS and other web technologies the internal friction of path separators must have been fun to experience. "Why are we still using \ again, Jim? Oh, that's right, we chose poorly a decade ago and for some reason can't be bothered to fix it!" > Dude, why are you so angry about what direction a slash goes? Because it's rubbed my bum raw over the years and I've finally had enough! I mostly jest... but seriously, it's super annoying to deal with and a constant reminder of the poor decision making Microsoft products often encompass.
- foobarian 3y agoYou know what happens when you write a \ --> / converter? You get the python2 to python3 migration mess. Except with Windows it would have been millions of mom and pop shops left out in the lurch.
- Alupis 3y agoNo it wouldn't - because Microsoft did write a \ -> / converter and none of this bad stuff happened. Microsoft just chooses to still display \ to you in the UI... which is ridiculous and perpetuates \ living on in all user-facing places.
- itslennysfault 3y agoAs a long time *nix user who briefly worked at Microsoft (and therefore on Windows), I was very happy to learn that Powershell is perfectly happy with forward slashes in paths. If you tab-complete it switches them to backslashes (which is "fine"), but you can type commands using forward slashes without issue. Also common linux commands (ls, cd, mv, cp) all work in Powershell. It really makes the transition painless.
- Alupis 3y agoI personally have found PowerShell to be obnoxious. It doesn't seem to know what it's supposed to be and tries to be everything all at once. The syntax for commands is super "Microsofty" if you know what I mean. I get around by using Git Bash (which is actually quite good for being a bundled afterthought), cygwin, or lately even WSL containers.
- sbelskie 3y agoWhat different things do you think it is trying to be?
- therein 3y agoI have nothing against PowerShell. I've used it for avoiding detection etc. in the past. Fun tool that surprises and delights in unexpected ways. It is pretty powerful/insane that stuff like this is a part of PowerShell and that's probably what the GP is talking about: Add-Type -TypeDefinition @" using System; namespace DemoCode { public class DemoClass { public static void WriteHello() { Console.WriteLine("Hello"); } } } "@ [DemoCode.DemoClass]::WriteHello() Or LoadLibrary call and invocation from PowerShell. [0] [1] It blurs the lines as to what it is no matter how you look at it. In contrast, try doing that in cmd.exe or invoking a function from a shared object after getting a pointer to it using dlopen through a POSIX shell. [0] - https://www.powershellgallery.com/packages/PSReflect-Functions/1.1/Content/kernel32%5CLoadLibrary.ps1 https://www.powershellgallery.com/packages/PSReflect-Functio... [1] - https://fuzzysecurity.com/tutorials/24.html https://fuzzysecurity.com/tutorials/24.html
- mardifoufs 3y agoWhy is / better than \ ?
- OsrsNeedsf2P 3y agoApart from the fact \ is used as an escape sequence?
- Alupis 3y agoFor starters, `\` is used for escape sequences for just about everything... meaning you now have to do the `\\` dance everywhere you need to write this path separator. Yes, it's true modern languages have things like `Path.separator` and stuff to abstract this away, but you cannot always use them in all contexts. It's small friction that adds up to a sore bum after a while...
- Joe_Cool 3y agoThe real fun starts with UNC paths. Is it `\\\\server\\share\ with\ space` or `//server/share\ with\ space` or any combination of those, preferably with quotes.
- saurik 3y agoFWIW, I have never wanted to put a \ in a filename, but I have often wanted to put a / in a (pretty) filename, as / is used in standard English all the time; I then find myself using "-" instead and that makes me unhappy. I'd much rather have seen ^ as the escape character and \ as the path separator.
- hollerith 3y agoYou can put slashes in filenames in MacOS's Finder app. If you use ls to view the filename, you'll see colons where Finder shows slashes.
- tracker1 3y agoWant to really mess with someone, do that on a mac file share on a windows server... You won't be able to do anything to that file or directory from Windows. Not sure if it's still an issue, but definitely was in the NT4/Win2k days.
- dekhn 3y agoI use forward and backward slash on Windows all the time. I think it's less of a problem of spaces in filenames, which makes a lot of pipe-related stuff harder to do (see find -print0 and xargs -0).
- asveikau 3y agoSpaces in filenames in the command line on Windows is a horror in part because there is no kernel level equivalent of argv. In the eyes of the Windows kernel, the command line is an unparsed utf-16 string, and it's up to the application or C library to tokenize it. This means there is no standard way to tokenize it. Ultimately, this means there is no standard way to escape a shell command's arguments, as you would need to do for spaces. Most people just put it in double quotes but this is pretty much the honor system.
- jiggawatts 3y agoJust use PowerShell. It has no issues with spaces anywhere, and uses explicit quoting rules similar to C# and other “proper” languages.
- asveikau 3y agoIf powershell is dispatching to other cmdlets then fine. If it needs to call CreateProcess on a win32 program then the issue I'm talking about definitely exists. (I don't personally like powershell but I don't think my gripes with it are really relevant to this thread.)
- dekhn 3y agoI don't think anybody else here is talking about CreateProcess. We're talking about the shell.
- asveikau 3y agoThis is how a shell works. It works by creating processes. On Unix, you create a process with fork() and execve(). Execve takes a list of arguments, already parsed and tokenized. A shell is free to interpret the command line however it likes to build this, but at the syscall level it is completely unambiguous what the parsed array looks like. On Windows, you call CreateProcess. This takes the command line as an unparsed string. It is the child process's responsibility to chop it up into argv. This is the source of ambiguity that I'm talking about.
- canucker2016 3y agoWindows used many of the MSDOS services, like file system access. Windows was built on top of MSDOS in the beginning. Windows predates OS/2 (OS/2 development started in 1985 according to Wikipedia) How is it a poor engineering decision? What about the original Mac OS using colon as a path separator? Or Lisa OS using the hyphen as a path separator? see https://retrocomputing.stackexchange.com/questions/17069/why-did-macos-classic-choose-the-colon-as-a-path-separator https://retrocomputing.stackexchange.com/questions/17069/why...
- TillE 3y agoYeah I think it's far more interesting to view this as a series of people making probably the best possible decision at the time, and winding up in a slightly unfortunate, suboptimal place. That's hardly uncommon! Examine the history of basically anything.
- naikrovek 3y ago> Microsoft reportedly wanted to use the forward slash as path separator, but IBM nixed the idea because it would have created an incompatibility with DOS 1.x, which already used the forward slash as a switch character, separating command options. It isn’t a poor engineering decision, that guy just didn’t read the decision criteria. Also, according to spec, CRLF is the proper sequence for a newline, and both Unix and MacOS chose incorrectly.
- Alupis 3y agoWhich spec would that be? It's not the ISO spec, nor POSIX. CRLF existed originally because of mechanical typerwriters required two separate actions - Carriage Return (move the carriage back to the start of the line), Line Feed (advance the page to the next line). CR is a waste for computing... it literally does nothing beneficial. Someone should figure out the climate impact of decades of wasted processing of CR characters... that might motivate people to fix this as well.
- naikrovek 3y ago> Someone should figure out the climate impact of decades of wasted processing of CR characters... that might motivate people to fix this as well. LF vs CRLF is a single molecule of water compared to the seven seas of waste created by Electron apps or even just JavaScript itself. Todays developers are lazy as FUCK and there is no pressure for them to stop being lazy. See: https://tonsky.me/blog/js-bloat/ https://tonsky.me/blog/js-bloat/ > CR is a waste for computing... it literally does nothing beneficial. When “LF” means “line feed and carriage return” both, as it does thanks to UNIX, yes. On teletype machines “line feed” meant “line feed” and “carriage return” meant “carriage return”. You need both. Today we use an LF which means both “CR” and “LF” and we act like CR is the problem, when it was us choosing a single byte to mean two separate things joined together. Even as a kid in school in typing class, I used a typewriter with a parallel port (probably serial, really, because you could use the keyboard without putting text on paper), and it could be used to print text sent to it. CR and LF had very different meanings on that typewriter. I wish I remembered what make and model it was…
- naikrovek 3y agoWindows existed before OS/2, though, and MS-DOS (where Windows’ path separator comes from) is of course even older. It’s ok to hate Microsoft, but hate them based on facts, and not whatever nonsense you have in mind.
- tracker1 3y agoIf you're using anything resembling modern Windows, you can use forward slashes for path separators and it works fine pretty much everywhere.
- skissane 3y ago> Let's not even start on the CRLF thing... CRLF is actually the Internet standard. It wasn't something Microsoft came up with, it was something they inherited from DEC > Yes, Windows owes it's origin to OS/2, and OS/2 used '\' instead of '/' - so we should never correct a decision inherited from an OS that died 22 years ago... That's not what the article actually says though. DOS 2.0 decided on '\' instead of '/', and both OS/2 and Windows inherited that decision from DOS.