Whats your go-to naming convention?
from Sunny@slrpnk.net to linux@lemmy.ml on 31 Aug 2024 18:08
https://slrpnk.net/post/12898579

As far as I know there are these;

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?

#linux

threaded - newest

friend_of_satan@lemmy.world on 31 Aug 2024 18:13 next collapse

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

Cris16228@lemmy.today on 31 Aug 2024 18:17 next collapse

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

gigachad@sh.itjust.works on 31 Aug 2024 18:20 next collapse

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@lemmy.ml on 31 Aug 2024 19:28 next collapse

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@lemmy.world on 31 Aug 2024 20:58 next collapse

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

sntx@lemm.ee on 01 Sep 2024 12:05 next collapse

Is something like this defined in a standard somewhere?

olafurp@lemmy.world on 01 Sep 2024 17:47 collapse

I can tell that this guy fucks

Telorand@reddthat.com on 31 Aug 2024 18:20 next collapse

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@lemmy.world on 31 Aug 2024 19:10 collapse

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…

MimicJar@lemmy.world on 31 Aug 2024 18:25 next collapse

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@lemmy.ml on 31 Aug 2024 18:28 collapse

Isnt CAPSLOCK case for screaming? 😁

GustavoM@lemmy.world on 31 Aug 2024 20:47 collapse

YEAH CRUISE CONTROL BABY

lnxtx@feddit.nl on 31 Aug 2024 18:25 next collapse

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

2xsaiko@discuss.tchncs.de on 31 Aug 2024 18:26 next collapse

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@programming.dev on 31 Aug 2024 19:22 collapse

spaces in filenames?
oh, my sweet summer child.

2xsaiko@discuss.tchncs.de on 31 Aug 2024 19:56 collapse

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

navi@lemmy.tespia.org on 31 Aug 2024 18:37 next collapse

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@beehaw.org on 31 Aug 2024 19:34 collapse

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@lemmy.tespia.org on 31 Aug 2024 20:56 collapse

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

Lettuceeatlettuce@lemmy.ml on 31 Aug 2024 18:40 next collapse

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

saigot@lemmy.ca on 31 Aug 2024 18:46 next collapse

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

don@lemm.ee on 31 Aug 2024 18:50 next collapse

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

L8R DOODZ

-SP4SEM4N B1FF

Sunny@slrpnk.net on 31 Aug 2024 21:06 collapse

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

[deleted] on 31 Aug 2024 21:50 next collapse

.

don@lemm.ee on 31 Aug 2024 21:51 collapse

It’s a reference to Tha Grate Biffinski:

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

BCsven@lemmy.ca on 31 Aug 2024 19:02 next collapse

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.

nyan@sh.itjust.works on 31 Aug 2024 19:15 next collapse

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

thingsiplay@beehaw.org on 31 Aug 2024 19:28 next collapse

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@fedia.io on 31 Aug 2024 20:11 collapse

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.

ZombiFrancis@sh.itjust.works on 31 Aug 2024 19:46 next collapse

Pascal_Snek_Case

ricdeh@lemmy.world on 31 Aug 2024 19:51 next collapse

Snake case for all kinds of file names and camel case for programming

Uncle_Abbie@lemmy.today on 31 Aug 2024 19:56 next collapse

For files, date+Snake: 20240831Letter_to_Rodney.odt For variables, Screaming

otp@sh.itjust.works on 31 Aug 2024 20:04 next collapse

Camel case, but with a twist – if the next word is about to start after a capital letter, I’ll have it lower case.

topSecretFBIfile.txt for example

CodexArcanum@lemmy.world on 31 Aug 2024 20:20 collapse

Interesting, I’d tend to demote the initialism, ie topSecretFbiFiles.tar.gz

otp@sh.itjust.works on 01 Sep 2024 23:27 collapse

That’s probably more commonly accepted. I defer to whatever my team is doing, but for my own files, I wouldn’t want things like UsStudentList or USStudentList which both look wrong to me.

USstudentList looks right to me, and if that’s wrong, I’m okay with being wrong! Haha

Hupf@feddit.org on 31 Aug 2024 20:06 next collapse

COOLFI~1.AME

TimeSquirrel@kbin.melroy.org on 31 Aug 2024 23:13 next collapse

10 PRINT "FARTS"
20 GOTO 10

harsh3466@lemmy.ml on 01 Sep 2024 02:01 collapse

Man I miss basic.

TimeSquirrel@kbin.melroy.org on 01 Sep 2024 02:25 collapse

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.

UnbalancedFox@lemmy.ca on 01 Sep 2024 05:06 collapse

Im dead! MS-DOS vibes

quantenzitrone@lemmings.world on 31 Aug 2024 20:07 next collapse

How about “cool file name”?

All my systems use modern file systems that are case sensitive and can contain any character except / and \0.

boredsquirrel@slrpnk.net on 31 Aug 2024 20:13 next collapse

True. Linux, Android, Windows all have no problems

Using dots in a file though…

Monstera@lemmy.ml on 31 Aug 2024 20:42 collapse

Using commands on that is still more annoying, so no way

quantenzitrone@lemmings.world on 31 Aug 2024 21:09 collapse

not really

You can easily escape spaces with \ and my modern shell (fish) suggests and completes filenames for me anyway, so i don’t have to type more than the first word in more than 90% of cases.

ouch@lemmy.world on 01 Sep 2024 04:35 next collapse

Typing \ in those cases instead of _ is super annoying.

In my keyboard layout backspace is behind altgr.

quantenzitrone@lemmings.world on 01 Sep 2024 14:54 collapse

the standard keyboard layouts (qwerty, qwertz, etc.) are mostly trash

are there any good alternative keyboard layouts for your native language (finnish if im not mistaken)?

In Germany there is the Neo Family: Neo{,2}, NeoQwert{y,z}, Bone, Mine, … as well as offsprings of that, but I guess you need your diacritics: å ä and ö. While Neo layouts have these diacritics available, they are made for german, so only ä ö and ü are easily accessible.

ouch@lemmy.world on 01 Sep 2024 20:46 collapse

Finnish indeed. I’m not aware of any alternative layouts. å is completely unnecessary for finnish, so maybe the layouts you mentioned could work.

delirious_owl@discuss.online on 01 Sep 2024 14:20 collapse

Now do it with a for loop on every file in a dir with thousands of files

quantenzitrone@lemmings.world on 01 Sep 2024 15:13 collapse

for i in path/to/dir/*
  dosomething_with_my_file $i
end

where is the problem? fish shell doesn’t split arguments at spaces

delirious_owl@discuss.online on 01 Sep 2024 17:30 collapse

$IFS splits files at spaces

quantenzitrone@lemmings.world on 01 Sep 2024 19:19 collapse

IFS is a special shell variable in bash, ksh and POSIX shells that lets you configure how the shell splits words

by default it splits at spaces tabs and newlines

I use fish a shell that is intentionally not POSIX compatible. While it borrows some principles from Bash and POSIX, it simplifies a lot of things and removes most footguns. Words are split at new lines in fish, which admittedly can also cause troubles, but not nearly as often as in bash and other POSIXy shells.

delirious_owl@discuss.online on 01 Sep 2024 21:44 collapse

Wtf why would you intentionally not be POSIX compatible?

quantenzitrone@lemmings.world on 02 Sep 2024 08:29 collapse

to make a good interactive shell

31337@sh.itjust.works on 31 Aug 2024 20:07 next collapse

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.

unknowing8343@discuss.tchncs.de on 31 Aug 2024 20:24 next collapse

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.

Sunny@slrpnk.net on 31 Aug 2024 21:08 collapse

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.

ouch@lemmy.world on 01 Sep 2024 04:30 collapse

Does alt+arrow work in your terminal?

Sunny@slrpnk.net on 01 Sep 2024 06:48 collapse

yeah

Monstera@lemmy.ml on 31 Aug 2024 20:44 next collapse

Kebab for most things, camel for source code

GustavoM@lemmy.world on 31 Aug 2024 20:46 next collapse

I go with the “quotation case”, “Cool file name”.

that_leaflet@lemmy.world on 31 Aug 2024 20:50 next collapse

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
cygnus@lemmy.ca on 31 Aug 2024 21:02 collapse

Counterpoint: you have to use Shift a lot

corsicanguppy@lemmy.ca on 01 Sep 2024 00:09 next collapse

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

ouch@lemmy.world on 01 Sep 2024 04:28 collapse

kdd

k4j8@lemmy.world on 01 Sep 2024 02:09 next collapse

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

elfahor@lemmy.blahaj.zone on 01 Sep 2024 12:32 collapse

Depends on your keyboard layout

bhamlin@lemmy.world on 31 Aug 2024 21:02 next collapse

For files, kebab case. For variables, snake case. For servers, megaman villains.

wildbus8979@sh.itjust.works on 31 Aug 2024 21:12 next collapse

CaN’t BeLiVe No OnE eLsE uSeS mOrOn ScRiPt FoR eVeRyThInG!

prex@aussie.zone on 31 Aug 2024 23:54 collapse

I ScRoLlEd ThIs FaR fOr SpOnGeBoB cAsE

wuphysics87@lemmy.ml on 31 Aug 2024 21:41 next collapse

IWRITELOTSOFBASH

jollyroberts@jolly-piefed.jomandoa.net on 31 Aug 2024 21:47 next collapse

Snake Case and Pascal Case is what I tend to default to

BrianTheeBiscuiteer@lemmy.world on 31 Aug 2024 22:18 next collapse

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

gerdesj@lemmy.ml on 31 Aug 2024 22:29 next collapse

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!

Professorozone@lemmy.world on 31 Aug 2024 23:37 next collapse

Snake case, but I’m the World’s second worst programmer and just name files like this because I was alive when spaces were not allowed.

Charadon@lemmy.sdf.org on 01 Sep 2024 00:28 next collapse

PascalCaseForTheWin

No1@aussie.zone on 01 Sep 2024 01:13 next collapse

IT’S

COOLFILE.NAM

THERE IS ONLY 8.3 AND THERE IS ONLY UPPERCASE

erwan@lemmy.ml on 01 Sep 2024 06:56 collapse

FILEID.DIZ

harsh3466@lemmy.ml on 01 Sep 2024 02:00 next collapse

Depending on the file it’s either dot notation or flat case.

captain_aggravated@sh.itjust.works on 01 Sep 2024 02:01 next collapse

I’ve got a personal convention that file names get snake case, directory names get Pascal case.

data1701d@startrek.website on 01 Sep 2024 02:17 next collapse

I do kebab with underscores.

MutilationWave@lemmy.world on 01 Sep 2024 03:39 collapse

Wouldn’t that be snake?

whoisearth@lemmy.ca on 01 Sep 2024 02:43 next collapse

Snake if writing in python

Camel if writing in PowerShell

I tend to stick with what the language wants me to use.

eruchitanda@lemmy.world on 01 Sep 2024 04:11 next collapse

Unless I can’t, Kebab.

No need to hold Shift.

jjjalljs@ttrpg.network on 01 Sep 2024 04:33 next collapse

Snake case, usually. Some perhaps unfounded fear that something will blow up on a dash in a file name kicking around. Or I’ll do a weird typo/premature enter and part of the file name will be treated like a -flag of some sort.

Landless2029@lemmy.world on 01 Sep 2024 04:37 next collapse

Rfc3339 plus kebab case for many things

2024-09-01_lname-fname-resume.pdf

sntx@lemm.ee on 01 Sep 2024 12:03 collapse

RFC3389 ?

Landless2029@lemmy.world on 01 Sep 2024 12:52 collapse
possiblylinux127@lemmy.zip on 01 Sep 2024 04:39 next collapse

My file

Fizz@lemmy.nz on 01 Sep 2024 04:46 next collapse

25% Camel case, 25% Pascal and 50% of the time flatcase. It drives me insane when I try and autocomplete a folder only to realise it was Downloads instead of downloads. I keep telling myself i will go through and make it all flatcase but I put it off because i tell myself i will rebuild my computer next week every week.

imecth@fedia.io on 01 Sep 2024 05:01 next collapse

Never thought about making the home folders flatcase, thanks, takes all of 2 minutes btw.
If anybody else wants to do it, remember to edit ~/.config/user-dirs.dirs with your new flatcase folders.

Amroth@feddit.it on 01 Sep 2024 09:02 collapse

I do the flatcase in my machines too, but it stopped being such big a nuisance to me when I moved to ZSH - it can autocomplete case-insensitively.

Fizz@lemmy.nz on 02 Sep 2024 09:01 collapse

Is zsh a terminal or a language like bash? I don’t get what it is from reading descriptions

[deleted] on 02 Sep 2024 09:10 collapse

.

Fizz@lemmy.nz on 02 Sep 2024 13:25 collapse

Thanks I’m gonna give it a go

MyNameIsRichard@lemmy.ml on 01 Sep 2024 06:14 next collapse

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.

SuperFola@programming.dev on 01 Sep 2024 08:47 next collapse

I use camel case for methods and functions and snake case for variables. And pascal case for constants. Why? I don’t really know, it makes for a nice distinction I guess.

Jessica@discuss.tchncs.de on 01 Sep 2024 09:01 next collapse

I’ve got one more to add to your list, and I hate it, but it’s worth mentioning: en.m.wikipedia.org/wiki/Hungarian_notation

It’s when the data type is in the name of the variable.

LunarLoony@lemmy.sdf.org on 01 Sep 2024 14:40 collapse

Oh, that was always the standard for Game Maker to differentiate between sprites and objects, which typically had similar names. It’s a difficult thing to unlearn!

communism@lemmy.ml on 01 Sep 2024 09:15 next collapse

Snake case. I find it the easiest to read.

tetris11@lemmy.ml on 01 Sep 2024 12:13 collapse

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

tatterdemalion@programming.dev on 01 Sep 2024 09:29 next collapse

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.

MyNameIsRichard@lemmy.ml on 01 Sep 2024 09:59 collapse

Given OP mentions kebab-case, this is probably about file-systems. But you are absolutely correct about code.

orangeboats@lemmy.world on 01 Sep 2024 10:13 next collapse

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”

thevoidzero@lemmy.world on 01 Sep 2024 11:28 next collapse

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

github.com/Atreyagaurav/nameit

sntx@lemm.ee on 01 Sep 2024 11:59 next collapse

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

luca@lemmy.today on 01 Sep 2024 12:41 collapse

You can go-to_hell.

MonkderVierte@lemmy.ml on 01 Sep 2024 11:36 next collapse

Depending on environment/language and policies. As long as its consistent throughout the project.

flashgnash@lemm.ee on 02 Sep 2024 12:23 collapse

My old projects still have camelCase sprinkled around, you can tell which bits are new and old depending on whether it’s camel or kebab

uzay@infosec.pub on 01 Sep 2024 12:12 next collapse

Snake case or kebab case I guess. But why is it called kebab case?

elfahor@lemmy.blahaj.zone on 01 Sep 2024 12:25 collapse

Because it looks like the words are on a rod, like kebab meat

uzay@infosec.pub on 01 Sep 2024 13:44 collapse

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.

LunarLoony@lemmy.sdf.org on 01 Sep 2024 14:37 collapse

Skewer case, perhaps?

uzay@infosec.pub on 01 Sep 2024 14:53 collapse

I like it

elfahor@lemmy.blahaj.zone on 01 Sep 2024 12:33 next collapse

Gotta live the Ocaml_case

HumanPerson@sh.itjust.works on 01 Sep 2024 13:46 next collapse

I took a CS class that was java based, and now my go-to is Pascal for file names. Sometimes I do flat or screaming just 'cause.

delirious_owl@discuss.online on 01 Sep 2024 14:18 next collapse

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

Allero@lemmy.today on 01 Sep 2024 15:35 next collapse

Using Windows is a true flex on Lemmy

QuazarOmega@lemy.lol on 01 Sep 2024 17:20 next collapse

touch "\"   \""
delirious_owl@discuss.online on 01 Sep 2024 21:45 collapse

What does this do?

noisypine@infosec.pub on 01 Sep 2024 22:33 next collapse

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.

QuazarOmega@lemy.lol on 02 Sep 2024 06:55 collapse

Mental damage

gamma@programming.dev on 02 Sep 2024 04:37 collapse

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

GissaMittJobb@lemmy.ml on 01 Sep 2024 15:04 next collapse

General purpose: Kebab case

But really, follow the conventions of what you’re working on. For example, I’d use pascal case when working on a Java/Kotlin project, and snake case when working on a Python project.

AllHailTheSheep@sh.itjust.works on 01 Sep 2024 15:44 next collapse

camel for java. flat for c

Meltrax@lemmy.world on 01 Sep 2024 15:49 next collapse

SCREAMING_SNAKE_CASE just has the best name

Tomkoid@lemmy.ml on 01 Sep 2024 16:22 collapse

YES, I USE THIS TOO TO STAY CONSISTENT WITH SQL QUERIES

sag@lemm.ee on 01 Sep 2024 16:29 next collapse

Pascal and Kebab case

Gobbel2000@programming.dev on 01 Sep 2024 16:51 next collapse

Snake case and kebab case mixed arbitrarily.

dependencyinjection@discuss.tchncs.de on 01 Sep 2024 17:06 next collapse

Pascal for server code running C# and Camel for client running TypeScript.

olafurp@lemmy.world on 01 Sep 2024 17:46 next collapse

I kebab case mine for personal files.

It’s mostly because I don’t have to use a modifier key and it’s doesn’t need url encoding and all in the same lowercase. Dot notation looks nice but I feel like dots are for extensions only. Flat case is horrible to read, screaming case even worse, camel/pascal case to many times ends up as coolFileNAme on first time typing.

I’ve done a couple of different styles because of programming in different languages but now if I have to do anything that’s not kebab case I make a small frown.

starshipwinepineapple@programming.dev on 01 Sep 2024 19:08 next collapse

Kebab or snake for ease of parsing through them.

Casuallynoted@pawb.social on 01 Sep 2024 21:02 next collapse

I’ve never been to a naming convention but I have been to some comic conventions!

pastermil@sh.itjust.works on 02 Sep 2024 02:57 collapse

You should, that’s how you can make a name for yourself!

featured@lemmygrad.ml on 01 Sep 2024 22:55 next collapse

If it’s something that will be mostly interacted with over CLI then kebab case. If GUI then spaces

zod000@lemmy.ml on 02 Sep 2024 01:38 next collapse

If its my own personal code, snake case, if I am sharing with my frontend devs then camel case. If I am writing short scripts, then flat.

model_tar_gz@lemmy.world on 02 Sep 2024 01:43 next collapse

stOcHaStIC-l33t-CasE FTW yizzo.

milicent_bystandr@lemm.ee on 02 Sep 2024 13:21 collapse

Are you including the spaces in your filenames?

model_tar_gz@lemmy.world on 02 Sep 2024 13:25 collapse

oFCoURsE! And the dot at the end with no file type extension? Also intentional.

KillingTimeItself@lemmy.dbzer0.com on 02 Sep 2024 03:57 next collapse

generally i still to camelcase if i have no separators, if i do have separators i stick to - now. _ sucks. I use . notation when dealing with copies of files.bak or something like that.

If i feel really special i throw a space in the name just because

kyub@discuss.tchncs.de on 02 Sep 2024 04:55 next collapse

code: camel or snake, depending on language

files/dirs: snake + kebab + dot mixture (trying to avoid caps and special chars here)

ian@feddit.uk on 02 Sep 2024 05:12 next collapse

This question just shows how messed up, and broken much of IT is.

fatalicus@lemmy.world on 02 Sep 2024 05:15 next collapse

Whatever case I get when my finger reaches the shift key.

milicent_bystandr@lemm.ee on 02 Sep 2024 13:20 collapse

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!

phoenixz@lemmy.ca on 02 Sep 2024 06:18 next collapse

Since Linux is caps sensitive, at least I always use lowercase.

I guess I use kebab case for any file used for IT projects

Zozano@lemy.lol on 02 Sep 2024 09:17 collapse

That’s why camelcase starts with a lower letter. If you’re using a good terminal+shell setup then it’ll be irrelevant most of the time.

Tovervlag@feddit.nl on 02 Sep 2024 07:37 next collapse

I generally end up using snake case.

7usr7local@lemmy.ml on 02 Sep 2024 09:13 next collapse

It heavily depends on the context: Filenames? Variables? Functions? Interfaces/Classes? Java? C? Shell?

milicent_bystandr@lemm.ee on 02 Sep 2024 13:17 collapse

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’

[deleted] on 02 Sep 2024 09:16 next collapse

.

TBi@lemmy.world on 02 Sep 2024 09:18 next collapse

Random mix and match. I’m all for diversity!

Zozano@lemy.lol on 02 Sep 2024 11:57 next collapse

Me, a sick fuck, who likes a quick fuck:

/etc/moron-syntax/I\ write\ like\ a\ gay\ fish\ \(\Kanye\)\
thedeadwalking4242@lemmy.world on 02 Sep 2024 12:08 next collapse

Camel case for short names snake case if it starts getting hard to read

flashgnash@lemm.ee on 02 Sep 2024 12:19 next collapse

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

netvor@lemmy.world on 02 Sep 2024 13:49 next collapse

my go_to NamingCovention: ANYTHING but camel-case 🤮

hakunawazo@lemmy.world on 02 Sep 2024 15:43 next collapse

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.

BaumGeist@lemmy.ml on 02 Sep 2024 17:52 next collapse

1337 case = k3wlf1l3n4m3

Revan343@lemmy.ca on 02 Sep 2024 19:36 next collapse

Pascal or Camel are best cases

guiguinofake@sh.itjust.works on 03 Sep 2024 05:07 next collapse

depends on the color of my mood ring

Epzillon@lemmy.ml on 03 Sep 2024 06:18 next collapse

Pascal or camel case for code, snake case for files and screaming snake case for globals

KE0VVT@midwest.social on 04 Sep 2024 22:16 collapse

  • Media: Cool_file_name
  • Other: cool-file-name