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?
Snake case. I find it the easiest to read.
I’m starting to warm up to Pokemon case, which would simplify functions like
GottaCatchThemAll()
to🍚()
or
this
to⚡🐹IchooseU
which I think we can all agree is much easier to read
For files, date+Snake: 20240831Letter_to_Rodney.odt For variables, Screaming
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.
While i do agree, snake looks a lot better too. I just wish it was possible to navigate through each parts of the word more easily with ctrl+arrow. That would make it the superiour choice imo.
Does alt+arrow work in your terminal?
Snake case for all kinds of file names and camel case for programming
IT’S
COOLFILE.NAM
THERE IS ONLY 8.3 AND THERE IS ONLY UPPERCASE
FILEID.DIZ
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
He probably uses vi. A few hundred more shift-key presses won’t stand out.
Depends on your keyboard layout
For this reason, I use kebab case for directories. But because I agree underscores show spaces better, I use snake case for files.
Pascal_Snek_Case
For files, kebab case. For variables, snake case. For servers, megaman villains.
Related: a list and explanation of variable naming conventions https://www.pluralsight.com/blog/software-development/programming-naming-conventions-explained
I go with the “quotation case”, “Cool file name”.
I do kebab with underscores.
Wouldn’t that be snake?
Kebab for most things, camel for source code
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.
CaN’t BeLiVe No OnE eLsE uSeS mOrOn ScRiPt FoR eVeRyThInG!
I ScRoLlEd ThIs FaR fOr SpOnGeBoB cAsE
IWRITELOTSOFBASH