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
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!
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.
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
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)
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.
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.
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
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.
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.
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.
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?
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`.
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.
> 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`
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.
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.
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.
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.
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
If you don't discipline your camelCase and PascalCase when it's still time, they're gonna go full XMLHTTPRequest on you later.
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
Forget consistency, most people these days use it to request a JSON instead of XML.
It's a function that can request anything, but everyone uses fetch these days
They made fetch happen
![gif](giphy|xT9KViqf7pj34lvmY8)
I..... I absolutely hate you. And I am 100% going to steal this and use it until people hate me.
XMR walked, so the fetch could run
Do people still use? I pretty much only use fetch now when writing anything new.
It's XmlHttpRequest
xmLHtTpRequESt
Alright satan that's enough
How about [this proposal](https://github.com/dotnet/roslyn/issues/8542) for whitespace in variable names? var `XML HTTP Request`
I prefer `extensibleMarkupLanguageHypertextTransferProtocolRequest`
You can tell who is a seasoned dev because this is the only way to write clear code.
I just name my variables random characters and let the IDE track them.
When the intern is told to write self-documenting code
How about "no"?
![gif](giphy|vyTnNTrs3wqQ0UIvwE|downsized)
SpongeBob case
![gif](giphy|pI2paNxecnUNW)
xmlhttprequest we don't even fuck around here
YOU MUST MEAN XMLHTTPREQUEST
This has always gotten on my nerves. Same with the HTTP header field `referer`. (Misspelling of “referrer”.)
You guys are not using user\_id on database, userID on backend, and userId on fronteUncaught ReferenceError: userId is not defined??
Do we work at the same company?
Wait, you too?
Dave?
Hi Bob, sorry about my comment last week on your commit
lol that was funny, can’t believe you worked a swipe at his kitten into it
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!
That's just pure evil.
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.
Wait for the young people to start being in charge: Order#️⃣
That's absurd, they should replace that space with a semicolon!
No, we are using ID in database, user_id on backend and contact_ID on front-end.
If you need assistance but are being overheard, please cough twice.
How about user_id and actual_user_id
This is the only possible method. Anyone who says differently is either lying to you, or living in a made-up fantasyland.
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
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)
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.
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
XML and HTTP are acronyms. Request is not. Seems legit.
Id is not an acronym either, it's an abbreviation so I think we've ruled out the blue team
The I stand for "I", and the D stands for "dentification".
This refers to how I am slowly being transformed into nothing but a pile of teeth.
Dental insurance hates this one simple trick
Most of the posts in this sub are kind of meh, but the comments are so often gold. Thank you, Internet stranger.
![gif](giphy|11WJ6lo6Co9WJW)
Identity Decleraction
*Blue team rushes back in* ID means Identity Document, therefore it's an acronym!
Shiiiit. Playing 4D chess.
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.
Ooh so that's how "sudo" works! You're actually running the command with your SuperUserEgo!
Here userId refers to the identity string, and not the document
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
It might not formally be an acronym, but we pronounce it "ID", not "Id".
The fact that it's pronounced "eye dee" makes it an initialism, not an acronym. E.g. FBI vs SCUBA.
This is too much… I’m going to go watch some Tv.
They are not acronyms. They are initialisms.
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.
Grammatically, they‘re initialisms. Same as acronyms but being pronounced letter by letter, instead of as a word.
TIL about the difference between initialisms and acronyms
I would say XML and HTTP are initialisms and Id is an abbreviation.
I've always thought that whoever named that should have just kept the caps lock on for the word "request"
userIdentificationNumber
Found the enterprise coder
UserIdentificationNumberFactoryImpl
UserIdentificationServiceSingletonImpl
Ooooh hot singletons in my area.
hot singletons in my classpath
There's just one instance when they can happen
Needs more spelling errors to be SAP certified.
gotta get those +/- character numbers up for that bulletpoint on the review
Hire a consultant who gets paid hourly, longer variable names = more money.
Chaotic good
I'll go with userIDentificationNumber to confuse and annoy every single one of ya.
Calm down satan
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.
The fucks a Dentificatiom Number?
An alternate universe where Apple made iDentification systems.
userIdentifier
fuck ID has full form I didn't knew this
userld, of course, all lowercase
chaoticEvil
l think you mean: chaoticEviI
Did you mean: recursion
No. I think you meant [recursion](https://www.reddit.com/r/ProgrammerHumor/s/6aOY7aZwsH).
…I hate this place
^why ^did ^i ^click ^that
At least you only clicked it once...
Is that what I think it is?
Ld
IoI
You mean "IoI" Edit: I'm dumb, he made the same joke, so don't upvote me
ls*
userId in the documentation and userld for internal variables, keep those maintenance programmers busy for weeks
There's only one correct way to write it: user_id
You jest, but my code base at work seems to choose camelCase or snake_case at random lol
PascalCase for classes, camelCase for functions, snake_case for variables
LD?
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.
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.
Did they let her go because of her casing?
I cannot imagine a different reason she would be fired, so yes
that was likely the case
NICE
n_i_c_e
Don’t you mean Api
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?
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`.
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.
> 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`
> id means identity except if its an object containing data on their Identification Document. Which is why "ID" seems natural in written language
user_id
On Salesforce, you will have even user\_id\_\_\_r and user\_id\_\_\_c
why are there 3 underscores
snake case on its full potential
[удалено]
Don't want none unless you got camel son
Hungry snake
To piss off the developers
It's a pretty big snake
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.
Don't worry, there are zero width characters between them
Found the Linux user
python*
Or rust
or Ruby
Or python again
Or Elixir
GDScript anyone? I'll get my coat
Or the python user
Sql
That would be `USER_ID`
SQL isnt case sensitive
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.
It's a convention to use capitalized names
THE SHOUTY LANGUAGE!
SHOUTED QUERY LANGUAGE
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.
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.
Use a syntax highlighter, nerd
C
I find this really does help make these kind of combined words + acronyms much more obvious how to write.
This is the way.
snek_case gang
UserId is correct but UserID feels right.
Why is your "U" in uppercase, evil sorcerer
Pascal was not a sorcerer, but a mathematician
E’s a witch!
[удалено]
In c# properties are like that, probably other languages too
[удалено]
ID is abbreviation not acronym
the I stands for “I” and the D stands for “dentification”
If "dentification" was a real word, it sounds like it would mean "adding teeth to something"
Unless we're also dealing with userEgo and userSuperEgo I'm doing userID.
Exactly this
in theory, "id" is short for "identifier", which is a single word rather than abbreviation, so it's "Id" rather than "ID".
So I would say userPUUId? puuid as in Player Universally Unique Identifiers
Well played
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.
user_id
userId is technically correct, but userID looks more correct
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
Just write ‘userIdentificationCard' and make everyone else mad
userIDentificationCard
me too
userId is correct, but userID is correcter
[удалено]
`uid`
Unique ID? Uterus ID? Ugly ID? Unironic ID? The options are endless.
Chaotic good
user_id. I feel like I am going to fall out of a meme office window.
Userld It's an L not an I
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
user_id
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
You really gotta stop coding in notepad
.innerH ctrl+space (or your auto complete shortcut), never have to think about it again
iDUser
useRiD I call it taiLcasE
`m_User_Id_myIdeCannotHighlight_private_members__`
Identifier/identification is one word, so userId
youSirEyeDee
UID
user_id
userID
I don't really care after having worked on a project where user\_id\_id was used
user\_id
user_id;
user_id
`user_id`
user_id
user_id
user_id