As far as I know there are these;

  • Camel case = coolFileName
  • Snake case = cool_file_name
  • Kebab case = cool-file-name
  • Pascal case = CoolFileName
  • Dot notation = cool.file.name
  • Flat case = coolfilename
  • Screaming case = COOLFILENAME

Personally I prefer the kebab/dot conventions simply because they allow for easy “navigation” with (ctrl+arrow keys) between each part. What are your preferences when it comes to this? Did I miss any schemes?

  • Epzillon@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    Pascal or camel case for code, snake case for files and screaming snake case for globals

  • Telorand@reddthat.com
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I like Camel Case for code, but mostly because it’s ingrained in my brain, coming from Java as my first language.

    For folders and files, I like Kebab Case.

    • Treczoks@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Luckily, I was not ingrained by my first programming language like that, or my coworkers would strangle me.

      I started with BASIC, which allowed only two letters for variable names…

  • Cris16228@lemmy.today
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    Both snake and camel case. Sometimes I mix it in the same project and I hate myself for it

  • MimicJar@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I use flat case most of the time, but I also try to stick to single word files so there is no case to get in the way.

    I think for documents I might share like a PDF I’d use Pascal case.

    In a classroom or teaching setting I will sometimes use Kebab case as I find it is the least confusing and makes it extra clear where the word division is. Similarly I avoid Dot notation since it’s confusing for folks coming from a Windows world.

    And I would avoid Screaming because that’s just too loud anywhere.

  • saigot@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    FileName_IMPORTANTCATEGORIZATION.yyyy.ext

    With all bits being optional (not every file needs the date it refers to)

    So eg (slight modifications for anonymity):

    SunLifeInsureance_SIGNED.2024.Q1.pdf

    SpotDoesTrickAndFalls_ORIG.mp4

    JSmithPassport_CANADA.2015_2025.pdf (I am a dual citizen)

    JSmithCOVIDPass_DOSE1.2021.pdf

  • 2xsaiko@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    For files? I like title case (like in article headlines). For example, I have a “Shell Tricks.txt”. I’m not really consistent though, sometimes it’s all lowercase or whatever really.

  • gigachad@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    It depends a bit on the use case. I try to follow naming conventions within specific environments like Python. When just sorting some documents together, I usually do a mix of Kebab and snake case, where I split semantic parts with underscores and connect words with dashes like

    2024-08-30_author_document-name_other-important-info.ext

    • Odin@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      This is exactly what I do. It lends itself to something like ‘prefix_specific-info_version’ which is both sortable and easy to read.

    • N0x0n@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      2 months ago

      Yeahh that’s the best IMO ! But I get most of the time stuck with some testOFtest001 files/directory… cause I’m lazy…

      But I always ALWAYS regret it afterward… :/

  • otp@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Camel case, but with a twist – if the next word is about to start after a capital letter, I’ll have it lower case.

    topSecretFBIfile.txt for example

      • otp@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        That’s probably more commonly accepted. I defer to whatever my team is doing, but for my own files, I wouldn’t want things like UsStudentList or USStudentList which both look wrong to me.

        USstudentList looks right to me, and if that’s wrong, I’m okay with being wrong! Haha

  • thingsiplay@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I don’t have a consistent style for everything and it depends on the circumstances. snake_case is often used, especially to avoid spaces. Sometimes I just do flatcase instead, and in rare cases also kebab-case or combined_snake-and-kebab-case. The combined_case is often useful to group parts of the name, like a dates and version numbers together and to indicate what part is constant; example-name_2024-08. Sometimes I also do the “Title Case”, which is basically PascalCase, but with spaces. Or even even more weird, “Python_Case”, which is PascalCase, but with snake_case, when I want to avoid spaces.

    I often avoid dots in regular filenames, unless they indicate a file extension or format, such as “.svg” and “.inkscape.svg” to indicate its a specific version of the SVG format. Or “.xiso.iso”, as a specific compressed version of the regular ISO file (for use with Xemu emulator). Basically the same logic and tradition as “.tar.gz” (but in reverse order).

    • Rhaedas@fedia.io
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      I don’t like extra dots simply because pattern matching might get weird down the road. Keep dots for extension type and use Pascal to make it easier to read multiple words. Flatcase only if it’s short or I’m lazy for a temp file.

  • 31337@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    camelCase for non-source-code files. I find camelCase faster to “parse” for some reason (probably just because I’ve spent thousands of hours reading and writing camelCase code). For programming, I usually just use whatever each language’s standard library uses, for consistency. I prefer camelCase though.

  • zitrone 🍋@lemmings.world
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    How about “cool file name”?

    All my systems use modern file systems that are case sensitive and can contain any character except / and \0.

      • zitrone 🍋@lemmings.world
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        not really

        You can easily escape spaces with \ and my modern shell (fish) suggests and completes filenames for me anyway, so i don’t have to type more than the first word in more than 90% of cases.

        • ouch@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          2 months ago

          Typing \ in those cases instead of _ is super annoying.

          In my keyboard layout backspace is behind altgr.

          • zitrone 🍋@lemmings.world
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago

            the standard keyboard layouts (qwerty, qwertz, etc.) are mostly trash

            are there any good alternative keyboard layouts for your native language (finnish if im not mistaken)?

            In Germany there is the Neo Family: Neo{,2}, NeoQwert{y,z}, Bone, Mine, … as well as offsprings of that, but I guess you need your diacritics: å ä and ö. While Neo layouts have these diacritics available, they are made for german, so only ä ö and ü are easily accessible.

          • zitrone 🍋@lemmings.world
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago
            for i in path/to/dir/*
              dosomething_with_my_file $i
            end
            

            where is the problem? fish shell doesn’t split arguments at spaces

              • zitrone 🍋@lemmings.world
                link
                fedilink
                arrow-up
                0
                ·
                2 months ago

                IFS is a special shell variable in bash, ksh and POSIX shells that lets you configure how the shell splits words

                by default it splits at spaces tabs and newlines

                I use fish a shell that is intentionally not POSIX compatible. While it borrows some principles from Bash and POSIX, it simplifies a lot of things and removes most footguns. Words are split at new lines in fish, which admittedly can also cause troubles, but not nearly as often as in bash and other POSIXy shells.