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?

  • delirious_owl@discuss.online
    link
    fedilink
    arrow-up
    5
    ·
    8 months ago

    I put an unnecessary amount of spaces in all my file names to break anyone who wants to use CLI tools on them

    i use windows btw

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

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

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

  • hakunawazo@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    8 months ago

    I use PascalCase for classes, camelCase for functions and variables, SCREAMINGCASE combined with snake_case for constants and for filenames/folders mostly snake_case with kebab-case if date or timestamp is involved.

  • ian@feddit.uk
    link
    fedilink
    English
    arrow-up
    1
    ·
    8 months ago

    This question just shows how messed up, and broken much of IT is.

  • flashgnash@lemm.ee
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    8 months ago

    Have been defaulting to kebab case for variable and function names in all languages recently because of cargo yelling at me

    Pascal case for class names cause c#, snake case for python files because it doesn’t like kebab

    Screaming case for env files because that’s what everybody else does

  • Leaflet@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    8 months ago

    Snake case.

    • Starts with a lowercase, good for shell autocompletion
    • No spaces, so no worrying about spaces in shell commands
    • ‘_’ is better than ‘-’ because it shows the spaces between words more clearly
      • k4j8@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        8 months ago

        For this reason, I use kebab case for directories. But because I agree underscores show spaces better, I use snake case for files.

  • Telorand@reddthat.com
    link
    fedilink
    arrow-up
    1
    ·
    8 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
      1
      ·
      8 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…