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?

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

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

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

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

  • BrianTheeBiscuiteer@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    18 days ago

    Kebab. Not my favorite visually speaking but I had RSI issues for a while and I’m still very focused on limiting keystrokes (no shift key needed with kebab).

  • gerdesj@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    18 days ago

    I like to use my enterprise number and a UUID (all in lower case, for legibility). Here’s an example:

    .1.3.6.1.4.1.33230.0d456e46-67e6-11ef-9c92-7b175b3ab1f1
    
    

    Now you might say that the UUID is already globally unique or at least pretty unlikely to turn up anywhere else, so why bother prefixing it with more stuff? To that I say: “I need to be absolutely or at least reasonably sure … OK nearly sure”.

    Anyway, you maintain a database of these things and then attach documentation and meaning to them. An editor could abstract and hide that away.

    I started this post as a joke. Not sure anymore. Why get your knickers in a twist with naming conventions for variables and constants. Programming is already a whopping layer of abstraction from what the logic gates are up to, another one wont hurt!

  • MyNameIsRichard@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    18 days 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.

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

  • tatterdemalion@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    18 days 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
      ·
      18 days ago

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