Live data from Hacker News

I'm “still afraid to use spaces in file names” years old

twitter.com

111–120 of 817 posts

Re: I'm “still afraid to use spaces in file names” years old

#111

If putting spaces in file names makes you queasy, try punctuation - especially punctuation like semicolon or ampersand or single quote that's meaningful to shells and such. Also, emoji.

Or for more fun, use language specific characters, like äöüß...

And even more fun is, when it mostly works, but then it doesn't and you notice too late.

Re: I'm “still afraid to use spaces in file names” years old

#112

One of the main reasons why Windows used "Program Files" and "Documents and Settings" was to force the programs (and programmers) to deal with paths with spaces. And you know, for the most part it kinda, more or less worked out although of course even today you will find programs that ask you to install them in a folder without spaces in the path.

And that was a good idea, if only Microsoft also fixed the CreateProcess function, Windows would be somewhat sane in this regard. But somehow nobody seemed to think of it. Seriously, look at it: https://docs.microsoft.com/en-us/windows/win32/api/processth... The arguments are a single string. So you want to pass parameters with spaces in them? You've got to add quotes and stuff all of that into a single string. Inste…

The root cause is that argv isn't a first-class citizen like on linux, but an abstraction. The kernel only cares about a single string argument. If you use main instead of WinMain, the CRT will transform the single string into an argv for you.

Oh and cmd.exe uses a different escaping scheme than the CRT.

Re: I'm “still afraid to use spaces in file names” years old

#113
post #86

Earlier quoted context omitted.

You state that as if that were objective.. but that's not my subjective experience at all. Somehow I have a hard time remembering these long names, (is it --conf or --config or --config-file or --config-path? -c would've done it for me. --set or --set-prop or --set-property or --prop or --property?), and I need to look them up in a man page anyway, and I make more typos typing them, and shell completion rarely works…

The shell ought to be able to help with that. There's no need to remember if it's --conf or --config if you can press --conf . One of the things I like about Fish is that by default it can tab-complete program options and also shows a one-line description of what each of them does. (It grabs that info from the man page).

So much of computing is dedicated to solving problems that could be omitted.

Re: I'm “still afraid to use spaces in file names” years old

#114
post #86

Earlier quoted context omitted.

You state that as if that were objective.. but that's not my subjective experience at all. Somehow I have a hard time remembering these long names, (is it --conf or --config or --config-file or --config-path? -c would've done it for me. --set or --set-prop or --set-property or --prop or --property?), and I need to look them up in a man page anyway, and I make more typos typing them, and shell completion rarely works…

The shell ought to be able to help with that. There's no need to remember if it's --conf or --config if you can press --conf . One of the things I like about Fish is that by default it can tab-complete program options and also shows a one-line description of what each of them does. (It grabs that info from the man page).

> and shell completion rarely works well if at all

Re: I'm “still afraid to use spaces in file names” years old

#116

I work on a complex desktop application, and it's been astounding the number of bugs that have appeared over the years triggered by spaces and other unusual characters in file names. If you do anything with subprocesses or path processing, it's absurdly easy to hit in a thousand different ways, over and over again. Pro tip: rename your development directory (or even better: the workspace path in CI) to put a space an…

While I agree that we should do this in the ideal world, doing so will inevitably break other necessary tools so it is unworkable for me :(

Re: I'm “still afraid to use spaces in file names” years old

#118

Earlier quoted context omitted.

Sure. One could also make "move-down-one-line" be the incantation to move the cursor down a line in vi, but I prefer j. Ergonomics isn't all about making everything self-descriptive for someone seeing the thing for the first time. It's about making things comfortable to actually use. If it's so long and complicated that you can't even remember how to do it, it's not very comfortable to use. Even if I could remember,…

It should be based on frequency of usage. I can tell you that moving down a line in vim is a little more common than toggling the mouse acceleration. I would never even type such a command. I would just copy paste it once.

It should be, but how would you keep track of usage frequency?

At least it would push all the "This switch was added by someone playing with UNIX at a university in 1986 and hasn't been used since" options to the end of the list.

Re: I'm “still afraid to use spaces in file names” years old

#119
post #47

Earlier quoted context omitted.

I seem to remember bash losing preferred escaping when TAB-completing, but can't reproduce it now with 5.0.17. Eg. you'd type `ls -l "Spaced [TAB]` and it would turn it into `ls -l Spaced\ Name`. I remember similar annoyances with other special shell characters (eg. single quotes, dollars, slashes), but that all seems to behave sane now.

I didn't even know this was a thing, but can't say I've ever preferred an escape style. I actually use backslashes a fair bit, usually just with spaces. I tend to reserve double quotes for variable or shell expansion, explicitly.

It's not so much about a preference, but your cursor would jump about and you'd need to be on the lookout if you wanted to edit the completion (eg. to change the extension).

Re: I'm “still afraid to use spaces in file names” years old

#120

I work on a complex desktop application, and it's been astounding the number of bugs that have appeared over the years triggered by spaces and other unusual characters in file names. If you do anything with subprocesses or path processing, it's absurdly easy to hit in a thousand different ways, over and over again. Pro tip: rename your development directory (or even better: the workspace path in CI) to put a space an…

Seems like MS had the same idea according to an answer in the link:

> Microsoft intentionally made programs install to C:\Program Files on Windows 95+ to force programmers to deal with spaces in filenames.

Post reply on HN