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?

  • zod000@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    If its my own personal code, snake case, if I am sharing with my frontend devs then camel case. If I am writing short scripts, then flat.

  • gigachad@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    5 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

    • N0x0n@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      5 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… :/

    • Odin@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      5 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.

  • 2xsaiko@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    5 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.

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

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

  • MyNameIsRichard@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    Kebab case with Pascal case in the usual places. I’d change to all kebab case but the muscle memory of typing Documents would nearly kill me.

  • tatterdemalion@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    The only correct answer is to be consistent with the code base you’re working in or the language’s conventions. If neither of these conventions exist, then someone has already failed you.

    • MyNameIsRichard@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      Given OP mentions kebab-case, this is probably about file-systems. But you are absolutely correct about code.

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

      I’m starting to warm up to Pokemon case, which would simplify functions like

      • GottaCatchThemAll() to 🍚()

      or

      • this to ⚡🐹IchooseU

      which I think we can all agree is much easier to read

  • MimicJar@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    5 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.

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

    Depending on environment/language and policies. As long as its consistent through the project.

    • flashgnash@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      My old projects still have camelCase sprinkled around, you can tell which bits are new and old depending on whether it’s camel or kebab

  • orangeboats@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    It really depends.

    If I know I will never open the file in the terminal or batch process it in someways, I will name it using Common Case: “Cool Filename.odt”.

    Anything besides that, snake case. Preferably prefixed with current date: “20240901_cool_filename”

  • thevoidzero@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    Underscore to delineate different parts, hypen to delineate words.

    Like: my-resume_draft.pdf

    And to make it consistent and easier to reuse parts for project names and such, I have a command line utility written for it. It caches the parts and uses a template system (support for generating current datetime in parts)

    Available here (is in AUR too):

    https://github.com/Atreyagaurav/nameit