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?
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”
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.
Isnt CAPSLOCK case for screaming? 😁
YEAH CRUISE CONTROL BABY
Pascal or camel case for code, snake case for files and screaming snake case for globals
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 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!
depends on the color of my mood ring
Pascal or Camel are best cases
Gotta live the Ocaml_case
Unless I can’t, Kebab.
No need to hold Shift.
My file
Snake case or kebab case I guess. But why is it called kebab case?
Because it looks like the words are on a rod, like kebab meat
Huh thanks, I guess it’s based on a misunderstanding of the word kebab then. Correctly it would have to be called şiş/shish case then, but that certainly has less of a ring to it.
Skewer case, perhaps?
Snake Case and Pascal Case is what I tend to default to
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.
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):
Thats what I do as well. It makes it easy to seperate between logical units.
You can go-to_hell.
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.
Given OP mentions kebab-case, this is probably about file-systems. But you are absolutely correct about code.