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
531–540 of 817 posts
Re: I'm “still afraid to use spaces in file names” years old
#532Earlier quoted context omitted.
The problem is we're optimizing for "easy to learn" rather than "easy to use".
In a world of broken promises and tool churn, minimizing tooling investment isn't laziness, it's a defense mechanism. This is a lesson I had to learn the hard way, multiple times.
Re: I'm “still afraid to use spaces in file names” years old
#533Spaces 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
#534Earlier quoted context omitted.
The problem is we're optimizing for "easy to learn" rather than "easy to use".
That may be a part of the problem but honestly I don't feel like all these new crazy interfaces are easy to learn either. I mean how do you come up with the lithany xinput calls for? You need to understand the syntax for specifying a device. You need to know that you're to set a libinput property, and you need to know the name of that property, and it's not documented in xinput man page, and of course you need to kno…
alias mouseoff='xinput set-prop 11 "Device Enabled" 0'
alias mouseon='xinput set-prop 11 "Device Enabled" 1'
Kind of ridiculous if you ask me.Re: I'm “still afraid to use spaces in file names” years old
#535Spaces 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.
But, of course, if you mix the abstractions of metadata (filename) with location, things won't be trivial.
Re: I'm “still afraid to use spaces in file names” years old
#536I'm hardly afraid but I just think it's poor ergonomics. Same as the move from xset m 0 0 to xinput --set-prop 'pointer:Logitech USB Receiver' 'libinput Accel Profile Enabled' 0, 1 Everything seems to be going this way in Linux land. Longer names, harder to type names, camelcase names, spaces... I'm looking forward to an OS that treats command line ergonomics as a first class feature and where camelcase & spaces are…
Long option names are more descriptive, more easily distinguished, and easier to remember. Your shell should be intelligent enough to provide tab completion for option names, assuming it is configured to.
Wait, are you saying that I need to change my shell or config to make up for another tool's poor design?
No, thanks.
Re: I'm “still afraid to use spaces in file names” years old
#537Shells are indeed the main culprits for the continued fear of spaces, but not the only ones. A lot of programs that deal with "metadata" which will then generate database tables and stuff like that, still struggle when working with any sort of special character. And the same for anything that, behind the scenes, just feeds text into regexes.
Re: I'm “still afraid to use spaces in file names” years old
#538I'm not young, but I've been using Macintosh computers regularly since 1990, and even back then file names could be up to 31 characters long, and could include any character except colon.¹ So I'm pretty comfortable using spaces, and sometimes even non-ASCII characters, in file names. Also back then Mac file names typically did not include an extension, because the file's type was stored as part of the metadata in its…
However, I found the lack of a command-line to be restricting.
Re: I'm “still afraid to use spaces in file names” years old
#539Earlier quoted context omitted.
You get all those space characters working and then some jerk comes along and uploads a file like this: ŗ̶̧̢͓̳͍͙͔̳̻̥͉̭͓̫̟͍̞̭͉͓͉̮̹͍͚̳̹̬͉͚̰͈̘̐̊̾̈̀̒͒̀͛̓̋̔͊̏͘̚ę̴̨̛̣͙̤̟̬̩̟͙͖̥̹̱̱̊͑͗̇̇͛̆̈́̃͋̓̀̔̍̍̌̐͊̎̓̅̀̕ͅģ̴̹̜̘͍̱̑͐̉̌̐̄̊͛̎́̐̌̅̈́͂͑̈́̋̔͂̊̊̒̒̔͛͆̚͘̕͠e̶̙͕̫̳̘͐̾́̑͆̓͂̿͊̊̍͛͐̌̆͗̌̅̅̔͊̂͛͗̅̕͝͝͝͝x̵̢̧̦̫͖̝̥̹͓̬͖̤̩͚̝̫̋̃̅̈́̆͋̌͑́̎̈́̊̾͒̀̒̎̓͛͊̿̓͊̀̍͐̆̚͝͝-̴̨̮̯͖͖̠̜̲̪͕̘͈͖̮̈́̓̐̃́̅̄̏́̍̉̐͌́̔̓̄͋͗̐̕͜͝ţ̴̢̧̖̗͖̞̮̫̦̼̝̺̼̱̳͓͉̜̟̤̲͖̻͙́̌̈̌̈͆̾̄͊̿̏̓͗̈́̕͜ͅh̶̽́͊̎͐͌̆̍̎̏̕͝…
Please don't Zalgo on HN. It's enough to speak its name.
Re: I'm “still afraid to use spaces in file names” years old
#540Earlier quoted context omitted.
Word of warning from hard experience: rn is a really dangerous thing to name a function because it is one char away from rm.
Looks like it's typically run without any arguments, so it's probably fine.