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…
I'm “still afraid to use spaces in file names” years old
571–580 of 817 posts
Re: I'm “still afraid to use spaces in file names” years old
#572Spaces in filenames were a mistake to begin with. Spaces are used to separate parameters in the command line. There's also no real need for filenames to support spaces.
Re: I'm “still afraid to use spaces in file names” years old
#573Slightly off topic but I find myself stuck at being "please for the love of god don't use spaces in git branch names" old. Anno dazumal this might not even have been an issue and I'm just cargo culting.
And on that topic, git branches are case sensitive but windows filesystem API isn't. Git branches are materialized on the filesystem as files and directories.
https://stackoverflow.com/questions/1976007/what-characters-...
Re: I'm “still afraid to use spaces in file names” years old
#574Earlier quoted context omitted.
Using the W functions has been the advice from Microsoft's documentation for ages. But people still use the A functions because they're easier, especially when writing cross-platform software since Windows is the only major OS that made the unfortunate choice of having the base character type 16 bits wide. Fortunately the future of the Windows API does look better since Microsoft has now added proper UTF-8 support si…
> since Windows is the only major OS that made the unfortunate choice of having the base character type 16 bits wide Apple OSes use something they call "unichar" inside NSStrings. I'm not 100% sure what it is, but it feels like it's the same 16-bit wide character.
Re: I'm “still afraid to use spaces in file names” years old
#575Re: I'm “still afraid to use spaces in file names” years old
#576Earlier quoted context omitted.
This goes for most instances of user input. Timestamps is the other common one people get wrong. I've even seen programs that pass around timestamps as strings in multiple formats and as integers (Unix time).
As a programming noob, I'm wondering what would be the better way to pass or return a unix time value as opposed to an integer?
Re: I'm “still afraid to use spaces in file names” years old
#577Earlier quoted context omitted.
> By the way: what's your beef with en dashes? Of all the changes in that list, removing the character that doesn't appear on a standard keyboard seems like the least controversial...
A better question might be "how did it get there in the first place?"
Whether people or processes, something is likely to introduce the character at some point.
Re: I'm “still afraid to use spaces in file names” years old
#578Earlier quoted context omitted.
> By the way: what's your beef with en dashes? Of all the changes in that list, removing the character that doesn't appear on a standard keyboard seems like the least controversial...
A better question might be "how did it get there in the first place?"
Re: I'm “still afraid to use spaces in file names” years old
#579Earlier quoted context omitted.
> FWIW, and it should be food for thought, every single Git repository in the world contains a pre-commit hook sample (disabled by default but it's there) that enforces that every committed file in the repo is named using a subset of ASCII characters. I use Git for documents too, not only code. Why shouldn't I use my native language?
Tab completion don’t work well for languages that require IME. That is one reason why I don’t.
Re: I'm “still afraid to use spaces in file names” years old
#580Earlier quoted context omitted.
Early on in my Linux-using-life I made the mistake of deleting /etc. That was a learning experience like no other :)
Since Live CDs/Flash drives were invented, I wouldn't worry about this stuff any longer. Certainly have your personal files in a centralized location and backed up first. Probably the easiest way to experiment these days is to create a VM and make snapshot, then start knocking down walls, just to see when and where the house collapses. Then revert and try something new.
There could be a competition!