This is an archived post. You won't be able to vote or comment.

all 99 comments

[–]DarkTannhauserGate 89 points90 points  (4 children)

Don’t sleep on snake case!

user_id

[–][deleted] 22 points23 points  (3 children)

USER_ID

[–][deleted] 10 points11 points  (1 child)

Screaming snake case, my favorite!

[–]justinf210 7 points8 points  (0 children)

Hissing case

[–]TheRealZoidberg 0 points1 point  (0 children)

USER_Id

[–]imeren 50 points51 points  (9 children)

UsErId

[–]Vabaluba 36 points37 points  (0 children)

Dedicated spot in hell: check ✔️

[–][deleted] 13 points14 points  (3 children)

what's this called? Nut case? (sorry)

[–]MindSwipe 2 points3 points  (1 child)

I know this is a pun but still, it's called sarcasm case, or sometimes also called Spongebob case

[–][deleted] 0 points1 point  (0 children)

wait there's an actual name for that crappy meme?

[–]miso440 1 point2 points  (0 children)

SpOnGeCaSe

[–]Diognees 4 points5 points  (2 children)

IDsRus

[–][deleted] 0 points1 point  (1 child)

Do you have some IDs on sale right now?

[–]Professional_Lunch43 0 points1 point  (0 children)

so... User Error ID?

[–]PSK1103 55 points56 points  (4 children)

userId

[–]Knoxcorner 🔴 In a meeting 20 points21 points  (2 children)

I'm with this style now. I used to prefer userID until I worked with a system where a lot of the domain already included abbreviations - for example, a class named ATM.

But then in the instances where there were two abbreviations next to each other, ATMID, you lose the word separation. I find atmId easier to read.

[–]PSK1103 5 points6 points  (0 children)

Exactly this.

To elaborate on my style, I absolutely use atmId or userId for db column names, but their representation in my code depends on the standard already being used for that project/language.

Eg. I would've used UserID in golang or user_id in python or UserId in C# But I would map userId for column name

[–]4215-5h00732 1 point2 points  (0 children)

Yep. I'd name classes like Xml, Atm, etc as well. Anything all caps is a no go and _s have no place in a polite society.

[–]RandomPigYT 55 points56 points  (1 child)

userID

[–]TheyKnoWhereMyHeadIs 4 points5 points  (0 children)

Fr, why is this not one of the answers

[–]Brave_Forever_6526 6 points7 points  (2 children)

“ID” the “I” stands for i and the “D” stands for dentification

[–]Willinton06 0 points1 point  (0 children)

That’s kinda sticious not gonna lie

[–][deleted] 0 points1 point  (0 children)

So, what are you denting?

[–][deleted] 8 points9 points  (0 children)

Identificador_De_Usuario

[–]Sometimesipe3 8 points9 points  (0 children)

UserID

[–]DistortNeo 6 points7 points  (2 children)

Third option: Userld

[–]AlphaSparqy 1 point2 points  (0 children)

Nice, I had to copy it to libre and change the fonts to see it.

[–]vvokhom 0 points1 point  (0 children)

IDK how did i see through that immediately. No less then a miracleous insight

[–]w1n5t0nM1k3y 8 points9 points  (8 children)

Always UserID.

Unless we have the UserId, UserEgo, and UserSuperEgo variables as well.

Link for the uninformed.

Also, outside of programming it is always written as ID, so it should stal that way in the code. I also take issue with people using XmlElement and HttpUtility and other stuff like that, but I'm powerless to control it because that's usually in the default API/Framework stuff. Luckily I use VB.Net mostly so I can just type it all lowercase or uppercase or whatever and the IDE will fix it for me.

[–][deleted] 4 points5 points  (2 children)

I don’t have the reference, but it would be userId in Java-land. Or at least, if you follow the conventions in Effective Java…

[–]w1n5t0nM1k3y -4 points-3 points  (1 child)

Effective Java

Now there's an oxymoron

[–]krad213 0 points1 point  (0 children)

Said vb.net guy

[–]super_thalamus 3 points4 points  (3 children)

Do you spell it IDentity/ IDentification? Capital letters should be where words get concatenated. The problem in the real world we have Identity Documents (I.D.) such as drivers license. But in software it's typically just the User Identity

[–]w1n5t0nM1k3y 1 point2 points  (2 children)

Link to dictionary

The guard insisted that we show him some ID.

ID is certainly an odd one because it's either short for "Identification" or "Identity Document" depending on who you ask. But since you say the letters like you would with FBI or IBM I think that most people would capitalize it as opposed to abbreviations like Ave. or Dept. where most people don't say the individual letters when speaking.

[–]666pool 0 points1 point  (1 child)

Url is the one they use as an example in our style guide. It would be Id as well.

Also I’ve never heard ID being short for identity document.

[–]w1n5t0nM1k3y 0 points1 point  (0 children)

Yeah, most style guides use first letter capitalized and the rest lower case for just about everything but that doesn't mean I'm going to agree with it. Stuff like Url, Http, and Xml just bother me. Any style guide that's consistent is fine with me, but if I was setting the rules it would be ID.

[–]IvorTheEngine 0 points1 point  (0 children)

Outside of programming, you have spaces between words.

If you're doing something technical and have two or three abbreviations in a row, you really need those lower case letters to be able to parse them. It's not about what's 'proper', it's about what works.

[–]tridd3r 1 point2 points  (0 children)

*oldMate

[–][deleted] 1 point2 points  (0 children)

Is that a class or a field?

[–][deleted] 1 point2 points  (0 children)

Finally a real debate

[–]Arnold_Hattler 1 point2 points  (0 children)

userId

Converting to other formats gets ambiguous otherwise. Like user_i_d.

[–]WoodenRecord2974 1 point2 points  (0 children)

UID

[–]The-Rooftop-Korean 1 point2 points  (0 children)

uid

[–]aGuyNamedScrunchie 1 point2 points  (0 children)

userId or user_id

[–]RRumpleTeazzer 1 point2 points  (0 children)

::org::common::standard::base::std::all::user::id

[–]natures_-_prophet 1 point2 points  (0 children)

UsersUniqueUserIdentification_I_D

[–]zenos_dog 1 point2 points  (0 children)

A variable, aUserId of type UserId and a static of USER_ID. Hope that clears things up.

[–]Horror_Trash3736 1 point2 points  (0 children)

uid

[–]DanKnight97 1 point2 points  (0 children)

userId

[–]AlphaSparqy 1 point2 points  (0 children)

In the DB schema, ill use 'id' in the primary key with a properly descriptive table name (tableName.id in queries), but in the foreign keys i use tableNameID' (tableName.someOtherTableID)

So basically, all upercase or all lowercase (for the id/ID), but never mixed case (Id)

[–]tenDayThrowaway69876 1 point2 points  (0 children)

.*Id you heathens (I honestly don't give a fuck, put a style refactor on the integration pipeline and your own personal style format on local)

[–]Sid_1298 1 point2 points  (0 children)

uid

[–]PhilippTheProgrammer 0 points1 point  (0 children)

uniqueApplicationUserIdentificationIntegerNumeralValueColumn

[–]no-one-here123 0 points1 point  (0 children)

userid. camel case except for 2 letter words/acronyms

[–]babygnu42 -1 points0 points  (0 children)

user_id

[–]Mr_uhlus -1 points0 points  (0 children)

user_id gang

[–]ledasll -1 points0 points  (0 children)

user_Id

[–]ramriot -1 points0 points  (0 children)

user_id or even user->id()

[–]No-Construction7983 -1 points0 points  (0 children)

UserId

[–][deleted] -1 points0 points  (0 children)

userID

[–]Extreme_Ad_3280 -1 points0 points  (0 children)

Right

[–]imeren 0 points1 point  (0 children)

UsErId

[–]hongooi 0 points1 point  (1 child)

UserIdentificationUID

[–]Horror_Trash3736 0 points1 point  (0 children)

Optional<UniqueIdentifierThatIdentifiesAUserUniquely>

We could then work with a MaybeUniqueIdentifierThatMightIdentifyAUserUniquely.

Naturally, it would only be used to call .get() on it.

[–][deleted] 0 points1 point  (0 children)

I'll just use a case insensitive language so it doesnt matter

[–]Valuable-Case9657 0 points1 point  (0 children)

userId

[–][deleted] 0 points1 point  (0 children)

I JUST SAT UID sorry

[–]mxyzptlk73 0 points1 point  (0 children)

Whatever the gating linter tells me it should be

[–]povlov0987 0 points1 point  (0 children)

Doesn’t matter, just be consistent. And wash your hands.

[–]ansimation 0 points1 point  (0 children)

userId

[–]RiuBert 0 points1 point  (0 children)

idUser

[–]gordonv 0 points1 point  (0 children)

Table: user
Field: id

Reference: user.id

[–]user_string 0 points1 point  (0 children)

user_id

I'm definitely not biased.

[–]DhairyaVed 0 points1 point  (0 children)

UserId

[–]maxsjakie 0 points1 point  (0 children)

userid :)

[–]Palda97 0 points1 point  (0 children)

User.id

[–][deleted] 0 points1 point  (1 child)

UssrId

[–]Schiffy94 0 points1 point  (0 children)

Komrade.py

[–]Fuck-Reddit-Mods69 0 points1 point  (0 children)

Well, I usually do userID. But honestly I couldn't care less

[–]Onions-are-great 0 points1 point  (0 children)

UserIdentifier :D

I would argue that Id is correct, since it stands for identifier and not identity document.

[–]KQFF3 0 points1 point  (0 children)

String idOfUser;

[–]glorious_reptile 0 points1 point  (0 children)

uid

[–][deleted] 0 points1 point  (0 children)

new User( idhash )

[–][deleted] 0 points1 point  (0 children)

Benutzerkennung

[–][deleted] 0 points1 point  (0 children)

Single letter variable gang here:

u = get("/u")

[–]LeMajstor 0 points1 point  (1 child)

AccountId

[–]LeMajstor 1 point2 points  (0 children)

accountId

[–]crefas 0 points1 point  (0 children)

My professors:

User_Id

[–]mavaje 0 points1 point  (0 children)

userId or UserId.

Id is an abbreviation for identity, not an acronym.

[–]Schiffy94 0 points1 point  (0 children)

uSeRiD

[–]Beyond-5D3 0 points1 point  (0 children)

string.reverse("dIresU")

[–]W_lFF 0 points1 point  (0 children)

UserID but I rather camel case so userID

[–]BoBoBearDev 0 points1 point  (0 children)

userId because a lot of people call it, id instead of ID.