Edit: Thank you guys for your insightful answers!

64 points

I use command line a lot. I hate needing to add backslashes before spaces or put quotes around file names. It’s easier to just use underscores.

permalink
report
reply
54 points

Spaces are not the end of the world, but very annoying:

On a bash command line, they make it harder to handle a list of files returned by a command as argument to another.

On the command line (lin or win), they require escaping or quoting when used as arguments or script/executable names.

On many programs, if you cut&paste the complete path to the file (for example in a network drive), you can click on the path and it will access the file, but spaces in filenames or directories breaks that (and it’s not bad programming, the program simply can’t guess where the link ends).

When you mention the name of the file in a documentation or message, it may lead to misintepretation, and it’s just fugly:

“You can find more information in the attached document file.pdf”.

What is the name of the file? it can be “the attached document file.pdf”, “attached document file.pdf”, “document file.pdf” or “file.pdf”.

Also when mentioned in a text, the file name may end up split in separated lines or even pages, and will more likely be subject to autocorrect.

When copying the file name in a text, in most environments you can double-click to select the whole name, but it doesn’t work if it has spaces.

Now, if you never ever type or copy/paste a file name, and only ever access files through a graphical interface, then it makes no difference.

But then you start getting to comfy and if anything goes, why not non-ascii chars too? And that opens a different can of troubles.

permalink
report
reply
3 points

Browsers also dont like them!

permalink
report
parent
reply
40 points

Instead of spaces? Not necessarily but it helps prevent edge cases

permalink
report
reply
25 points
*

Also, hasn’t been said yet, but when a file name with a space is uploaded to the net, the url will replace spaces with “%20” (for technical reasons), making the URL looking bad

(but still not mandatory to replace spaces by underscodes)

Example: http://example.com/the%20file%2042.png vs http://example.com/the_file_42.png

permalink
report
reply
4 points

Ohhhhhhhhhhh, neat.

permalink
report
parent
reply
23 points

WelcomeToCamelCaseMyFriend.png

permalink
report
reply
21 points

ThatIsPascalCase thisIsCamelCase

permalink
report
parent
reply
10 points

But then you have to press shift if you want to use the file in Linux terminal…

permalink
report
parent
reply
4 points

…But at least it saves you from having to use quotes or escaping out the spaces with \

permalink
report
parent
reply
3 points

I’d rather use snake_case for file names in Linux that way you don’t have to press shift until the end of the first word, and byt that time you probably have enough characters for tab completion.

permalink
report
parent
reply
1 point

Or make your shell be case-insensitive

permalink
report
parent
reply
0 points

or pressing capslock before and after each uppercase, if you’re one of those people

permalink
report
parent
reply

Asklemmy

!asklemmy@lemmy.ml

Create post

A loosely moderated place to ask open-ended questions

Search asklemmy 🔍

If your post meets the following criteria, it’s welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

Icon by @Double_A@discuss.tchncs.de

Community stats

  • 10K

    Monthly active users

  • 5.9K

    Posts

  • 319K

    Comments