Edit: Thank you guys for your insightful answers!

  • Dandroid
    link
    fedilink
    601 year ago

    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.

  • jsveiga
    link
    fedilink
    541 year ago

    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.

    • Nioxic
      link
      English
      31 year ago

      Browsers also dont like them!

    • wootz
      link
      331 year ago

      I know I don’t have to but it feels dirty

        • @[email protected]
          link
          fedilink
          English
          41 year ago

          8.3 is horrible in almost any moderately complex system. We have one at work and you basically need a index / translation document to figure out what the files or scripts do. The Database tables have similar short name limits.

          You eventually memorize the ones you use often but it creates a huge new / external parties to understand the system.

  • RCMaehl [Any]
    link
    411 year ago

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

  • Jakylla
    link
    fedilink
    English
    25
    edit-2
    1 year ago

    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

  • @[email protected]
    link
    fedilink
    191 year ago

    TLDR; No

    It hasn’t been necessary in a long time, unless you’re a developer who frequently needs to type in filenames in everywhere (since the command line needs extra protection against spaces and other symbols)

    The OS (Windows, Mac, Android, etc) handles thar all for you so you don’t have to worry about it (unless you happen to use a badly-written program that doesn’t understand spaces, but this is super rare to begin with, and more protected against as time goes on)

    • jsveiga
      link
      fedilink
      71 year ago

      Even non-developers may hate spaces in filenames, when links to the file you send in a message don’t work because clicking on them uses only up to before the first space.

  • @[email protected]
    link
    fedilink
    161 year ago

    That depends, if you have the fortune (misfortune?) of using the CAD software Creo/ ProE from PTC then spaces are verboten since they haven’t progressed from the days where the software was written for UNIX.

    • @Tug_Boat
      link
      41 year ago

      Damn this just made me realize why I use so many _ in my file names. Used to use PTC shit in a previous job very heavily.

        • @[email protected]
          link
          fedilink
          21 year ago

          To be fair mine only has an underscore because Lemmy doesn’t support periods in user names. I have actually barely used the software I was talking about and use another one that doesn’t care.

  • @VelociCatTurd
    link
    121 year ago

    Just in general? No. But I may still use spaces or camel case sometimes on Linux because it makes it a little faster for me to reference a file without escaping the spaces

    • tate
      link
      fedilink
      41 year ago

      Camel case is the way. Why use underscore instead of space when you could just,… not?

      • @[email protected]
        link
        fedilink
        21 year ago

        Stockholm syndrome from whatever the convention is for your daily programming language. Long live snake case 🐍

  • darcy
    link
    fedilink
    121 year ago

    never use spaces. never use special characters like |$&";?*'. avoid non-ascii. case is preference, i personally use kebab-case

  • 𝘋𝘪𝘳𝘬
    link
    fedilink
    41 year ago

    Windows has issues with leading spaces in certain applications, but no, you don’t need to replace spaces with underscores in general nowadays.