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?

  • thevoidzero@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    18 days 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

  • gigachad@sh.itjust.works
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    19 days 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
      1
      ·
      19 days 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.

  • /usr/local@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    17 days ago

    It heavily depends on the context: Filenames? Variables? Functions? Interfaces/Classes? Java? C? Shell?

    • milicent_bystandr@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      17 days ago

      I usually like to call my functions cool-Filename and my variables moronic_typeClass. Shell executable aliases look like ‘if\ then\ else’ and C constants are ‘IFTHANELSE’

  • delirious_owl@discuss.online
    link
    fedilink
    arrow-up
    3
    ·
    18 days 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

  • flashgnash@lemm.ee
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    17 days 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
    2
    ·
    19 days 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
        ·
        18 days ago

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

  • Epzillon@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    16 days ago

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

  • ian@feddit.uk
    link
    fedilink
    English
    arrow-up
    2
    ·
    17 days ago

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

  • hakunawazo@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    17 days 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.