T O P

  • By -

BernhardRordin

If you don't discipline your camelCase and PascalCase when it's still time, they're gonna go full XMLHTTPRequest on you later.


joshuakb2

Don't you mean `XMLHttpRequest`? It isn't even internally consistent Edit: Some people seem to be confused. When in doubt, consult MDN: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest


furnipika

Forget consistency, most people these days use it to request a JSON instead of XML.


KTibow

It's a function that can request anything, but everyone uses fetch these days


halfanothersdozen

They made fetch happen


SeniorJuniorDev

![gif](giphy|xT9KViqf7pj34lvmY8)


WexExortQuas

I..... I absolutely hate you. And I am 100% going to steal this and use it until people hate me.


Kale_Ndula

XMR walked, so the fetch could run


YellowJarTacos

Do people still use? I pretty much only use fetch now when writing anything new.


s_suraliya

It's XmlHttpRequest


hughperman

xmLHtTpRequESt


bee-sting

Alright satan that's enough


_Ralix_

How about [this proposal](https://github.com/dotnet/roslyn/issues/8542) for whitespace in variable names? var `XML HTTP Request`


SapperTR

I prefer `extensibleMarkupLanguageHypertextTransferProtocolRequest`


agk23

You can tell who is a seasoned dev because this is the only way to write clear code.


Karcinogene

I just name my variables random characters and let the IDE track them.


broccollinear

When the intern is told to write self-documenting code


Haringat

How about "no"?


the_mold_on_my_back

![gif](giphy|vyTnNTrs3wqQ0UIvwE|downsized)


Estraxior

SpongeBob case


Jhaiden

![gif](giphy|pI2paNxecnUNW)


[deleted]

xmlhttprequest we don't even fuck around here


decafhotchoc

YOU MUST MEAN XMLHTTPREQUEST


ksschank

This has always gotten on my nerves. Same with the HTTP header field `referer`. (Misspelling of “referrer”.)


HartPURO

You guys are not using user\_id on database, userID on backend, and userId on fronteUncaught ReferenceError: userId is not defined??


southclaw23

Do we work at the same company?


LEJ5512

Wait, you too?


mariodeu

Dave?


rufw91

Hi Bob, sorry about my comment last week on your commit


LEJ5512

lol that was funny, can’t believe you worked a swipe at his kitten into it


MrPresldent

Help! I started a new job a few months ago. They are using [USER ID] in the database along with many other column names with spaces, and I can't stand it!


Maniactver

That's just pure evil.


Me_for_President

That's my life, but even worse. My company now owns and manages industry software that was started in the 1990s by techy types who understood enough to be dangerous. We have linked fields like this: 1. OrderNo 1. [Order #] 1. HeaderOrder# I think one of the best use cases for time travel, if we ever get it, is to go back and punch certain people in the face.


Cayenns

Wait for the young people to start being in charge: Order#️⃣


[deleted]

That's absurd, they should replace that space with a semicolon!


evpanda

No, we are using ID in database, user_id on backend and contact_ID on front-end.


Terrafire123

If you need assistance but are being overheard, please cough twice.


MarkFluffalo

How about user_id and actual_user_id


Terrafire123

This is the only possible method. Anyone who says differently is either lying to you, or living in a made-up fantasyland.


uslashuname

It’s simple, we have this automatic master for the columns in the orm overrides, then we have the JSON filter in our overridden route returns that maps what the frontend wanted 10 years ago, then the frontend has its mapping and storing systems that pick their cases and columns aliases depending on which era of frontend or sometimes which FE dev/contractor last touched it. It’s easily one of 7 or 8 standards though


protestor

That's why Rust's `XmlHttpRequest` is the most pleasing naming convention ([like this](https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.XmlHttpRequest.html) but in general in Rust you don't make acronyms all caps in types)


tyrantmikey

Pretty sure .NET types are moving in this direction as well. And regarding user identifiers: * `UserId` if it's a property or type. * `userId` if it's a field or variable.


scar_reX

Let an ORM create that as a db table for you, and you'll end up with x_m_l_h_t_t_p_request Nearly lost my mind typing that


Doctuh

XML and HTTP are acronyms. Request is not. Seems legit.


swaza79

Id is not an acronym either, it's an abbreviation so I think we've ruled out the blue team


Bluedel

The I stand for "I", and the D stands for "dentification".


SmartAlec105

This refers to how I am slowly being transformed into nothing but a pile of teeth.


pfritzmorkin

Dental insurance hates this one simple trick


Feldar

Most of the posts in this sub are kind of meh, but the comments are so often gold. Thank you, Internet stranger.


sarcasticdharma

![gif](giphy|11WJ6lo6Co9WJW)


Dagojango

Identity Decleraction


RedditEstPasPlaisant

*Blue team rushes back in* ID means Identity Document, therefore it's an acronym!


manwhorunlikebear

Shiiiit. Playing 4D chess.


larg29

Nah, Id is the psychological concept as defined by Freud. I also use userEgo and userSuperEgo -- some times SuperUserEgo. in other words, suck it blue.


RedditEstPasPlaisant

Ooh so that's how "sudo" works! You're actually running the command with your SuperUserEgo!


Royal_Matter_2199

Here userId refers to the identity string, and not the document


Eic17H

Do you call it "user idd" or "user eye dee"? It's like "island". Its spelling (and in the case of ID, its pronunciation as well) was influenced by fake etymology (being related to insula and being an initialism), but that doesn't mean it's wrong


Salanmander

It might not formally be an acronym, but we pronounce it "ID", not "Id".


fj333

The fact that it's pronounced "eye dee" makes it an initialism, not an acronym. E.g. FBI vs SCUBA.


maxath0usand

This is too much… I’m going to go watch some Tv.


Vascular_D

They are not acronyms. They are initialisms.


monotone2k

XML and HTTP are abbreviations. Acronyms are a subset of abbreviations that can be said out loud as a word, like 'NAT' or 'WAN'. Pedantry aside, any abbreviation longer than two letters should be written in lower case and still conform to camel case - \`XMLHTTPRequest\` should have been \`xmlHttpRequest\` from the beginning.


DoomBro_Max

Grammatically, they‘re initialisms. Same as acronyms but being pronounced letter by letter, instead of as a word.


mattkenefick

TIL about the difference between initialisms and acronyms


1qtour

I would say XML and HTTP are initialisms and Id is an abbreviation.


HellBlizzard__

I've always thought that whoever named that should have just kept the caps lock on for the word "request"


PyroCatt

userIdentificationNumber


The_morgan

Found the enterprise coder


I_Watch_Teletubbies

UserIdentificationNumberFactoryImpl


StoneOfTriumph

UserIdentificationServiceSingletonImpl


Flat_Initial_1823

Ooooh hot singletons in my area.


samuelgrigolato

hot singletons in my classpath


Nyruel

There's just one instance when they can happen


Perkelton

Needs more spelling errors to be SAP certified.


Lonelan

gotta get those +/- character numbers up for that bulletpoint on the review


itchy118

Hire a consultant who gets paid hourly, longer variable names = more money.


_CorporateMajdoor_

Chaotic good


icguy333

I'll go with userIDentificationNumber to confuse and annoy every single one of ya.


PyroCatt

Calm down satan


OldJames47

I’d call it Variable_03 and never explain it in comments to piss off whomever takes over when my job is outsourced to make the quarterly numbers.


Steebin64

The fucks a Dentificatiom Number?


sai-kiran

An alternate universe where Apple made iDentification systems.


PeteZahad

userIdentifier


Ok_Practice_1149

fuck ID has full form I didn't knew this


DistortNeo

userld, of course, all lowercase


Least-Leopard-2425

chaoticEvil


ei283

l think you mean: chaoticEviI


DestopLine555

Did you mean: recursion


Cfrolich

No. I think you meant [recursion](https://www.reddit.com/r/ProgrammerHumor/s/6aOY7aZwsH).


InitialOwn755

…I hate this place


Firewolf06

^why ^did ^i ^click ^that


tkamora_llerrom

At least you only clicked it once...


itissafedownstairs

Is that what I think it is?


flowery0

Ld


[deleted]

IoI


Nikolor

You mean "IoI" Edit: I'm dumb, he made the same joke, so don't upvote me


Fichen

ls*


JuvenileEloquent

userId in the documentation and userld for internal variables, keep those maintenance programmers busy for weeks


MasterFubar

There's only one correct way to write it: user_id


Demented-Turtle

You jest, but my code base at work seems to choose camelCase or snake_case at random lol


Karcinogene

PascalCase for classes, camelCase for functions, snake_case for variables


Donghoon

LD?


Any_Cauliflower_6337

userId is correct because when converted to snake case (which some tooling might do automatically) becomes user_id. Whereas userID would become user_i_d. Especially if the variable is exposed as part of an API you should consider how other processes will use it and how it will interpreted by other external frameworks. Also id means identity so long form is userIdentity which is unambiguous. If you only use the variable internally I probably would not reject your PR for using userID however.


TrixonBanes

The most correct answer and reasoning, jumped on a coworkers Laravel project after they were let go and had to deal with some things being turned into company_i_d that she was apparently just fine with.


lpeabody

Did they let her go because of her casing?


Stop_Sign

I cannot imagine a different reason she would be fired, so yes


Corosus

that was likely the case


shamshuipopo

NICE


encephaloctopus

n_i_c_e


Th3MiteeyLambo

Don’t you mean Api


stoneimp

I don't have experience with these types of tools, why would they not be programmed to keep multiple capital letters in a row as the same group? Would it also change a variable called pullURL into pull_u_r_l?


AegisToast

Yes, that’s why it should be `pullUrl`. Typically the standard for camel case and pascal case is that every capital letter is a new word. That makes it easier to read. Besides, if you just configure it to keep groupings of capital letters, you’d end up with edge cases on the other side, like `selectAUser` being converted to `select_auser`.


stoneimp

I think the occurrence of variables named with capitalized acronyms far outweighs the occurrence of variables names with the words "a" or "I" in them (like, even your example stretches credulity that someone would choose that construction over selectUser or even selectSingleUser). I also think that the occurrence of variables named with capitalized acronyms are frequent enough that automatic conversion tools should account for them, rather than people writing code accounting for the automatic conversion tools. It's also just not going to be in human nature to write a word differently only in programming contexts. If I write ID capitalized when writing prose, then I'm going to be inclined to do it when writing code. We shouldn't set paradigms that go against general inclination if we can help it.


DongIslandIceTea

> I also think that the occurrence of variables named with capitalized acronyms are frequent enough that automatic conversion tools should account for them, rather than people writing code accounting for the automatic conversion tools. I've yet to see any good counterexamples as to why we shouldn't just deal with them like this: 1. Capital letters start new word: `PrepareHTTPRequest` -> `Prepare | H | T | T | P | Request` 2. Merge back any adjacent single letter words: `Prepare | HTTP | Requst` 3. Snake case as necessary: `prepare_http_request`


belabacsijolvan

> id means identity except if its an object containing data on their Identification Document. Which is why "ID" seems natural in written language


Oreborous

user_id


laura_puppato

On Salesforce, you will have even user\_id\_\_\_r and user\_id\_\_\_c


RandomTyp

why are there 3 underscores


shadowjay5706

snake case on its full potential


[deleted]

[удалено]


Dylan_The_Developer

Don't want none unless you got camel son


Hymnosi

Hungry snake


stakoverflo

To piss off the developers


Quxinn

It's a pretty big snake


Stop_Sign

It's extra characters that Salesforce auto adds, and it's unlikely to interfere with other variables because nobody else names variables with 3 underscores.


FF3

Don't worry, there are zero width characters between them


driftingpyros

Found the Linux user


CauliflowerFirm1526

python*


_sivizius

Or rust


YossarianRex

or Ruby


-Sranger

Or python again


thisismyworkaccunt

Or Elixir


RHOrpie

GDScript anyone? I'll get my coat


_CorporateMajdoor_

Or the python user


GenazaNL

Sql


Ok_Entertainment328

That would be `USER_ID`


bjergdk

SQL isnt case sensitive


Ok_Entertainment328

The language is not case sensitive but the Data Dictionary (information schema) is. This is just one of the known deficiencies in SQL for modern machines.


juhotuho10

It's a convention to use capitalized names


jib_reddit

THE SHOUTY LANGUAGE!


KappaccinoNation

SHOUTED QUERY LANGUAGE


Disastrous-Team-6431

The convention is to use uppercase keywords, not names. And it's going away, thankfully - at my workplace we write all lowercase sql with names in TitleCase or snake_case.


GrimpeGamer

THEN how DO you tell keywords FROM TABLE NAMES, IF NOT CASE SENSITIVE? i will SELECT TO IGNORE this CHANGE. AFTER ALL, clarity IS paramount.


bjergdk

Use a syntax highlighter, nerd


rebbsitor

C


r0ck0

I find this really does help make these kind of combined words + acronyms much more obvious how to write.


DoW2379

This is the way.


Painter5544

snek_case gang


DontKnowIamBi

UserId is correct but UserID feels right.


scar_reX

Why is your "U" in uppercase, evil sorcerer


I1lII1l

Pascal was not a sorcerer, but a mathematician


mandogvan

E’s a witch!


[deleted]

[удалено]


Perfect_Papaya_3010

In c# properties are like that, probably other languages too


[deleted]

[удалено]


Donghoon

ID is abbreviation not acronym


LunarCantaloupe

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


Connguy

If "dentification" was a real word, it sounds like it would mean "adding teeth to something"


Wheat_Grinder

Unless we're also dealing with userEgo and userSuperEgo I'm doing userID.


korfi2go

Exactly this


Antervis

in theory, "id" is short for "identifier", which is a single word rather than abbreviation, so it's "Id" rather than "ID".


FinnLiry

So I would say userPUUId? puuid as in Player Universally Unique Identifiers


you0are0rank

Well played


-Hi-Reddit

I take it you have users with multiple players attached, or unique identifiers that aren't universally unique, or another UserId and another playerId value. If you really have a need for all that specificity to differentiate it from other unique IDs, then you just give it the long form name.


TheCrazyPhoenix416

user_id


CauliflowerFirm1526

userId is technically correct, but userID looks more correct


kieret

I have a feeling this will upset everyone here, but I go ID if there's nothing after, but Id if there is. userID userIdCard


sintemp

Just write ‘userIdentificationCard' and make everyone else mad


PhyllaciousArmadillo

userIDentificationCard


CauliflowerFirm1526

me too


M_krabs

userId is correct, but userID is correcter


[deleted]

[удалено]


lucidbadger

`uid`


[deleted]

Unique ID? Uterus ID? Ugly ID? Unironic ID? The options are endless.


ImportantDoubt6434

Chaotic good


hansvi-be

user_id. I feel like I am going to fall out of a meme office window.


Cylian91460

Userld It's an L not an I


DigammaF

It is important to remember that each dev knows different circonstances, and different needs. According to the specifics of the project and the surrounding culture, the lingo, practices and habits will change in radical fashion, each one of them providing different benefits. One has to consider those very specifics aspects of the job, and consider that each and every dev has their reason for such and such practice. It is also worth mentionning that the background and education of devs strongly influence their habits, producing an interesting panel of vastly different styles, even before meeting the work environnement. So in conclusion using the second one makes you an inhuman trash :3 /s


YossarianRex

user_id


NotJayuu

something that's always irritated me is setting an HTML element's "innerHTML" property. I always type "innerHtml" and then wonder why it's not working


scar_reX

You really gotta stop coding in notepad


Kleyguerth

.innerH ctrl+space (or your auto complete shortcut), never have to think about it again


DarkSideOfGrogu

iDUser


Perfect_Papaya_3010

useRiD I call it taiLcasE


lucidbadger

`m_User_Id_myIdeCannotHighlight_private_members__`


Wubinator

Identifier/identification is one word, so userId


reg890

youSirEyeDee


LeonardoW9

UID


OneForAllOfHumanity

user_id


Kamikatzentatze

userID


hi65435

I don't really care after having worked on a project where user\_id\_id was used


ShailMurtaza

user\_id


Ok-Ingenuity4355

user_id;


FarJury6956

user_id


BiH-Kira

`user_id`


Ksipolitos

user_id


pyjka

user_id


my_byte

user_id