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?
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
Using Windows is a true flex on Lemmy
I put newlines in my filenames to break both CLI tools and Windows filesystems
touch "\" \""
What does this do?
Make a file named just a bunch of spaces with double quotes around them. It’s made confusing because of the 4 double quotes, two are escaped by the backslashes immediately before them.
Mental damage
Random mix and match. I’m all for diversity!
It heavily depends on the context: Filenames? Variables? Functions? Interfaces/Classes? Java? C? Shell?
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’
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
I can tell that this guy fucks
This is exactly what I do. It lends itself to something like ‘prefix_specific-info_version’ which is both sortable and easy to read.
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.
Camel case for short names snake case if it starts getting hard to read
SCREAMING_SNAKE_CASE just has the best name
YES, I USE THIS TOO TO STAY CONSISTENT WITH SQL QUERIES
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
I generally end up using snake case.
1337 case = k3wlf1l3n4m3
Whatever case I get when my finger reaches the shift key.
The guy on shift before you got the Case of the Missing Variable. What will you get when your finger reaches that shift? Who knows… It will remain… A_Mystery!
This question just shows how messed up, and broken much of IT is.
Pascal or camel case for code, snake case for files and screaming snake case for globals
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.
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
Counterpoint: you have to use Shift a lot
For this reason, I use kebab case for directories. But because I agree underscores show spaces better, I use snake case for files.
He probably uses vi. A few hundred more shift-key presses won’t stand out.