Live data from Hacker News

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

twitter.com

531–540 of 817 posts

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

#531

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…

Even capitalization is a pain in the ass thanks to how OSes treat file names. I pretty much stick with either `file-name.ext` or `file_name.ext` exclusively now.

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

#532
post #85

Earlier 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.

I've learned this lesson too, and I now avoid using any tools that have broken backwards compatibility in the past 20 years.

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

#534
post #85

Earlier 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

#535
post #533

Spaces 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.

Or, one could claim that the poor parsing of a text interface shouldn't dictate the for-human names of files, especially when an exceedingly small percentage of users deal with that text interface.

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

#536

I'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.

>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

#537
post #48

Shells 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.

Just this weekend I learned that the Espressif Framework doesn't like it aswell.

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

#538

I'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…

All of that was very cool and impressive and extremely user-friendly.

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

#539
post #407

Earlier 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.

It would be one thing if it was making other comments difficult to read or causing browser issues, but I appreciated the demonstration that both would presumably be possible on certain browsers

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

#540
post #472

Earlier 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.

A typo can go the other way, like "rn somefile" where it was meant to remove a file but instead it renames all files.
Post reply on HN