There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Whats your go-to naming conventions?

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?

thingsiplay ,

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).

Rhaedas ,

I don't like extra dots simply because pattern matching might get weird down the road. Keep dots for extension type and use Pascal to make it easier to read multiple words. Flatcase only if it's short or I'm lazy for a temp file.

nyan ,

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).

BCsven ,

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.

don ,

WIAT, Y R U CALLIN IT SCREAMING CASE THAT SOUNDS FKN DUM TBH

L8R DOODZ

-SP4SEM4N B1FF

Sunny OP ,

ive seen it be called both screaming and train case, not sure what the most used term is though.

don ,

It’s a reference to Tha Grate Biffinski:

en.m.wikipedia.org/wiki/BIFF_(Usenet)#

saigot ,

FileName_IMPORTANTCATEGORIZATION.yyyy.ext

With all bits being optional (not every file needs the date it refers to)

So eg (slight modifications for anonymity): SunLifeInsureance_SIGNED.2024.Q1.pdf SpotDoesTrickAndFalls_ORIG.mp4 JSmithPassport_CANADA.2015_2025.pdf (I am a dual citizen) JSmithCOVIDPass_DOSE1.2021.pdf

Lettuceeatlettuce ,
@Lettuceeatlettuce@lemmy.ml avatar

I try to make everything Pascal case. It’s easy to read in a terminal and pretty easy to type.

navi ,
@navi@lemmy.tespia.org avatar

I don’t like it but I am used to reading old C codebase (windows: learn.microsoft.com/…/coding-style-conventions) with Hungarian notation.

pszMyString 😥

thingsiplay ,

That’s called camelCase, right? starting off small and then use Upper. Hungarian notation is a form of camelCase, just with the type added in front I think. But that’s for coding standards, not filenames. One can think of Hungarian notation as to what file extensions is to files, just added in front. Imagine files named as “txt.MyFile”, just for illustration.

navi ,
@navi@lemmy.tespia.org avatar

Ah yes I dont know what I thought OP was asking about coding standards 😂

2xsaiko ,
@2xsaiko@discuss.tchncs.de avatar

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.

fuzzy_feeling ,

spaces in filenames?
oh, my sweet summer child.

2xsaiko ,
@2xsaiko@discuss.tchncs.de avatar

I don’t use a computer from the 90s. It can handle it.

MimicJar ,

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.

joeldebruijn , (edited )

Isnt CAPSLOCK case for screaming? 😁

GustavoM ,
@GustavoM@lemmy.world avatar

YEAH CRUISE CONTROL BABY

lnxtx ,
@lnxtx@feddit.nl avatar

Depends. Java-like languages ofc camel/pascal case.
Bash, Python, etc., snake case, with constants as uppercase.
Filenames: I prefer snake case.

Telorand ,

I like Camel Case for code, but mostly because it’s ingrained in my brain, coming from Java as my first language.

For folders and files, I like Kebab Case.

Treczoks ,

Luckily, I was not ingrained by my first programming language like that, or my coworkers would strangle me.

I started with BASIC, which allowed only two letters for variable names…

gigachad ,

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

N0x0n , (edited )

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… :/

odin ,
@odin@lemmy.world avatar

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

Cris16228 ,

A mix of snake and camel case. Sometimes I mix it in the same project and I hate myself for it

friend_of_satan ,

Related: a list and explanation of variable naming conventions pluralsight.com/…/programming-naming-conventions-…

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • lifeLocal
  • random
  • goranko
  • All magazines