Live data from Hacker News

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

twitter.com

701–710 of 817 posts

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

#701

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 conve…

things like this are why the Unix philosophy is so bad.

text processing is hard if you must support Unicode, and that means every Unix command line tool must implement or employ a text processor to handle input. it would be much easier if objects were passed back and forth. PowerShell got this right.

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

#702

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…

maintaining backwards compatibility means maintaining silly decisions, and Microsoft does both.

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

#703

Earlier quoted context omitted.

That order is not guaranteed consistent across installations, however.

I wonder if code to this effect has ever been written before for (int i = 1; i

Can that work for i > 9 ?

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

#705
post #636

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

non-ascii characters cause annoying hard to fix problems. If you're willing to deal with that - kudos. Personally I don't find it worthwhile

I haven't had problems yet. Spaces, punctuation, and quotes are the main offenders, most of the time.

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

#706

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

This used to be my default, and then I used Matlab, and "-" was interpreted as subtraction.

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

#707

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.

It not only keeps people on their toes due to the whitespace. The folder name is even localized. E.g. with german settings there is C:\Programme and c:\Programme (x86).

You can still use the English names, though.

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

#709
post #472
post #411

I have an overly-aggressive function in my .bashrc to rename all files in the current directory: # Rename all files in a directory rn() { rename "s/ /-/g" * rename "s/_/-/g" * rename "s/–/-/g" * rename "s/://g" * rename "s/\(//g" * rename "s/\)//g" * rename "s/\[//g" * rename "s/\]//g" * rename 's/"//g' * rename "s/'//g" * rename "s/,//g" * rename "y/A-Z/a-z/" * rename "s/---/--/g" * rename "s/-‎--/--/g" * } I use th…

Word of warning from hard experience: rn is a really dangerous thing to name a function because it is one char away from rm.

Note to self: snag “notTerseAtAllMoreVerboseIdentifiersForGreatGood.js” on NPM

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

#710
post #435

Earlier quoted context omitted.

Overly aggresive is right! I don't know if this is genius or deranged! I'm leaning towards genius and stealing the idea. By the way: what's your beef with en dashes? I mean, if it was "everything should be 'HYPHEN-MINUS' (U+002D)", then fine, but why specifically en dashes and not em dashes?

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

Opt+- if you use macOS, long press on - if you use any Apple touch OS.
Post reply on HN