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?

74 points
*

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

permalink
report
reply
12 points

This is exactly what I do. It lends itself to something like ‘prefix_specific-info_version’ which is both sortable and easy to read.

permalink
report
parent
reply
7 points
*

Yeahh that’s the best IMO ! But I get most of the time stuck with some testOFtest001 files/directory
 cause I’m lazy


But I always ALWAYS regret it afterward
 :/

permalink
report
parent
reply
2 points

I can tell that this guy fucks

permalink
report
parent
reply
2 points

Is something like this defined in a standard somewhere?

permalink
report
parent
reply
51 points

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
permalink
report
reply
35 points

Counterpoint: you have to use Shift a lot

permalink
report
parent
reply
25 points

He probably uses vi. A few hundred more shift-key presses won’t stand out.

permalink
report
parent
reply
1 point

kdd

permalink
report
parent
reply
4 points

For this reason, I use kebab case for directories. But because I agree underscores show spaces better, I use snake case for files.

permalink
report
parent
reply
2 points

Depends on your keyboard layout

permalink
report
parent
reply
42 points

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

permalink
report
reply
18 points

Using Windows is a true flex on Lemmy

permalink
report
parent
reply
8 points

I put newlines in my filenames to break both CLI tools and Windows filesystems

permalink
report
parent
reply
7 points
touch "\"   \""
permalink
report
parent
reply
5 points

What does this do?

permalink
report
parent
reply
14 points

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.

permalink
report
parent
reply
6 points

Mental damage

permalink
report
parent
reply
39 points

COOLFI~1.AME

permalink
report
reply
6 points

10 PRINT “FARTS” 20 GOTO 10

permalink
report
parent
reply
4 points

Man I miss basic.

permalink
report
parent
reply
4 points

https://www.freebasic.net/

It’s more like QBasic dialect, but it’s still actively maintained. It can generate binaries and everything for modern machines.

permalink
report
parent
reply
2 points

Im dead! MS-DOS vibes

permalink
report
parent
reply
27 points

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

permalink
report
reply
12 points

You can go-to_hell.

permalink
report
parent
reply
9 points

Thats what I do as well. It makes it easy to seperate between logical units.

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by AlpĂĄr-Etele MĂ©der, licensed under CC BY 3.0

Community stats

  • 8K

    Monthly active users

  • 3.7K

    Posts

  • 48K

    Comments