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?
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
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)
I am a fan of Python's or Rust's official conventions.
For package names, tho, I don't get why this-is-used over this_clearly_better_system, as I would expect a double click to select_the_whole_thing, whereas it does-not-happen-here.
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!
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.
25% Camel case, 25% Pascal and 50% of the time flatcase. It drives me insane when I try and autocomplete a folder only to realise it was Downloads instead of downloads. I keep telling myself i will go through and make it all flatcase but I put it off because i tell myself i will rebuild my computer next week every week.
For files? An unholy amalgam of snake, kebab and dot, depending on what exactly I'm trying to convey. (I still have much-ported files around with DOS 8.3 filenames, so they're truncated scream case (SCREAMIN.NAM), but I don't actively name files like that anymore.) The important thing is to separate the words/sections while using characters that are valid without escapes in both ext4 and vfat if at all possible.
For variable names, camel or Pascal case (depending on language convention) if I think anyone else is going to read it. Flat case for code I don't think anyone else is ever going to see (don't do this—it has left teethmarks in my ass from time to time and will do the same to you).
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).
I like snake, but in some interfaces the underscores blend into the text line or are not rendered properly, so it becomes eaaier to discern if the filename has spaces or separators by using kebab.
Snake case, usually. Some perhaps unfounded fear that something will blow up on a dash in a file name kicking around. Or I'll do a weird typo/premature enter and part of the file name will be treated like a -flag of some sort.
It's mostly because I don't have to use a modifier key and it's doesn't need url encoding and all in the same lowercase. Dot notation looks nice but I feel like dots are for extensions only. Flat case is horrible to read, screaming case even worse, camel/pascal case to many times ends up as coolFileNAme on first time typing.
I've done a couple of different styles because of programming in different languages but now if I have to do anything that's not kebab case I make a small frown.
But really, follow the conventions of what you're working on. For example, I'd use pascal case when working on a Java/Kotlin project, and snake case when working on a Python project.
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.
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.
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).
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.
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.
generally i still to camelcase if i have no separators, if i do have separators i stick to - now. _ sucks. I use . notation when dealing with copies of files.bak or something like that.
If i feel really special i throw a space in the name just because
I use camel case for methods and functions and snake case for variables. And pascal case for constants. Why? I don’t really know, it makes for a nice distinction I guess.