Live data from Hacker News

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

twitter.com

421–430 of 817 posts

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

#421
post #400

Earlier quoted context omitted.

Truly lifesaving for when she'll quoting gets in the way.

You've got a stray single quote in your shell. :)

That was a typo, but it seemed like a perfect illustration of my point, so I left it in.

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

#424
post #162

Earlier quoted context omitted.

> Pro tip: rename your development directory (or even better: the workspace path in CI) to put a space and/or special characters in it. A former co-worker changed his name in our auth system to include an apostrophe, so that whenever we handled names wrong he'd find it.

A related too for CI: change the system time to be a time zone that is during your work hours in a different day already than UTC. Really helped getting failures earlier than 4pm PST.

At my last job we had a wild time-zone bug that only happened with your system location set to Mumbai. I left mine set to that for the rest of my time there.

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

#425
post #348

Earlier quoted context omitted.

Wherever you want. All of the above, or none. It really is up to you.

That's exactly the problem. This leads to mess. The Windows model of C:\Program Files\ is much better.

When you download a portable app (just a bare .exe), do you make a folder for it and drop it in program files? (quite possible, you'd just be unusual) If not, why does Windows get a free pass?

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

#427
post #76

Earlier quoted context omitted.

I'd argue it's at most a tiny bit harder to read, and a lot easier to type. On balance I'd rather avoid making a pinky key one of the keys I have to use the most.

"On balance I'd rather avoid making a pinky key one of the keys I have to use the most." And you use something else than your pinky finger for the shift key specifically when typing capitalized letters for camelCase?

At least it's where they sit naturally on the keyboard. And the shift key is wider specifically so you don't have to be accurate with your pinky when you're pressing it. The underscore is one of the least ergonomic keys there is. And you need both pinkies to do it

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

#428

Earlier quoted context omitted.

I've recently shifted sharply toward the dash from the underscore. I find it more readable, and it doesn't require the shift key. However, I do find it useful to use underscores to create groups, e.g. test-001_2021-10-11.log. Including hours, minutes, seconds is still awkward.

There's a customer for everything. I've just never liked the aesthetics of the underscore. Also if your underscored thing gets put in some document and then underlined the underscores can become invisible.

A lot of this is personal aesthetics, for sure. Personally, I am not a big fan of camel casing. In code, I only use it for class names, generally. I don't find it particularly readable, and for filenames, not all filesystems are case sensitive, so best not to rely on case to differentiate files. Camel case does have the nice property of being more compact, as no character is required. That's its main benefit.

R traditionally uses the . as a legal character in identifiers. Once you get it used to not being syntactic, I found I actually prefer them to underscores.

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

#429
post #145

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…

"Path is not a string - it's a sequence of path components and should be treated as such by our APIs." For maximum correctness, you want to turn it into a file handle as soon as possible, and do all operations through the variations of the file functions that end in "at", like: https://linux.die.net/man/2/openat The downside of this approach is that you still technically have to carry the path around with you if you…

Another inconvenience with this approach is that you can keep thousands of paths in memory no problem. But thousands of FDs may cause you to exceed per-process limits.

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

#430

Maybe it's just me, but it always seemed like prohibiting spaces and other special characters was a reasonable way to avoid unnecessary complexity (and the bugs that accompany it) when parsing and navigating directory trees and files. I'm old enough to remember working with 8.3 filenames in DOS, and while the length limitation was maddening, the space part never was. Then Windows 95 came out and all restrictions were…

Related: David Wheeler's Fixing Unix/Linux/POSIX Filenames

https://dwheeler.com/essays/fixing-unix-linux-filenames.html

Post reply on HN