Live data from Hacker News

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

twitter.com

131–140 of 817 posts

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

#131
I have an uneasy feeling whenever I see a path parameter declared as string. Path is not a string - it's a sequence of path components and should be treated as such by our APIs. A path should be parsed once - on user input - and then used in its "sequence form" throughout the software stack.

And "path component" is not an arbitrary string either - e.g. appending a path component to the path should first require converting/parsing the string into the path component, and only if that's successful appending it to the path.

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

#133

If I'm going to use the file in the command line, I won't use spaces, since I don't know what sick bug I might encounter.

Same. For documents and stuff that I use in normiespace I give them friendly names with capitalization and spaces and such, but for anything I'm going to be working on via CLI I try to use filenames that will be easily chunked as "words" when doing things like double clicking it in terminal to select, ^w to erase it, tab completion etc.

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

#134

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…

It doesn't even have to be complex, often basic automation tasks fail with spaces and special characters. Honestly, treating a file system like a natural language processor is a bad idea. Besides at this point with how digital we have all become who can't understand...

thisismyconfig.txt vs this is my config.txt or this_is_my_config.txt

...i've forced myself to stop using spaces, character, and even cap. They are all constructs that provide minimal value for the extra complexity.

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

#135

Earlier quoted context omitted.

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.

And yet they introduced C:\ProgramData in later versions.

why "yet"?

one occurrence is enough to make devs care about it

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

#136

Earlier quoted context omitted.

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.

And yet they introduced C:\ProgramData in later versions.

Imagine if they made programmers put 64 bit DLLs in a "System32" directory and 32 bit DLLs in a "SysWoW64" directory. That would really keep 'em on their toes!

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

#138

Still way too many libraries and programs can't handle spaces in filenames. And shells and other programs still have problems with perfectly legal characters in filenames too, like '!' or ':'.

Was recently encoding my Stargate: SG-1 DVDs to move them to plex. I was encoding it on a system other than what was serving it, so I had to copy it. It's surprisingly difficult to "scp" a file with a colon in it directly.

I also love when you're using bash and you have a file with ! in the name, and you accidentally fail to correctly backslash it, you not only get "bash: !rest_of_filename: event not found", but it also fails to add that command line to the history, so you can't just hit up and fix it. You have to actually go to the mouse and copy and paste.

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

#139

I am also that age, and kebab-case is the best case for filenames. 2021-01-01-some-important-document.pdf gives me the warm fuzzies. On the off chance that some more differentiation is needed, throw in an underscore and a whole new world opens up

In my work, today's date would be 21K11, to save space over the longer date.

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

#140

I am also that age, and kebab-case is the best case for filenames. 2021-01-01-some-important-document.pdf gives me the warm fuzzies. On the off chance that some more differentiation is needed, throw in an underscore and a whole new world opens up

> kebab-case

I hadn't heard that before and I love it.

Post reply on HN