Conversation

eli, vampire kitsune

Edited 8 months ago
when using upper camel case, how should "player ID" ideally appear without considering pre-existing project or team naming conventions?
24% PlayerId
72% PlayerID
2% some secret third thing
0
6
4
followup: how should XML HTTP Request appear given the same convention?
53% XMLHTTPRequest
38% XmlHttpRequest
7% XMLHttpRequest
0% XmlHTTPRequest
0% other thing
0
2
2

@rowan oh no i used to remember the proper capitalization for this off the top of my head and now i can't blobfoxsweating

0
0
1

@rowan Rust conventions, goes for PlayerId/XmlHttpRequest, most other languages go for PlayerID/XMLHTTPRequest; we greatly prefer the former

0
0
2

@rowan as weird as PlayerId and XmlHttpRequest look, I still think they’re overall better because they remove ambiguity which is much more important (IMO) than aesthetics

my first impulse in the first poll was PlayerId but I didn’t remember why lol (just a vague sense that it was less ambiguous) but this second poll reminded me of exactly where that ambiguity comes from

2
1
4
@kasdeya hehe that's actually the exact reason i made a second poll! aesthetically, i like the capital letters for abbreviations and acronyms but i totally agree with you: clarity is way more important
0
0
3

@kasdeya @rowan This makes sense to me, it removes a lot of ambiguity.

On another note about ID/id/Id, it's technically an abbreviation of identity, not an acronym, so I would consider the lowercase d from that perspective too, even if ID is a very common usage. (Just to open a new can of worms lol)

1
0
2

@Shivaekul @kasdeya what you brought up is actually what got me curious about this in the first place!

overwhelmingly the most common way to abbreviate identity/identification/identifier seems to be with “ID” (with both letters being capitalized) since, i think, the alternative would be “Id.” or “id.” when written in plain english. the latter is maybe more syntactically correct but it seems like the tendency is to use the former.

i thought it was interesting that in the case of “player ID,” using PlayerID seems to be the most intuitive and clear except when compared to a case like “XML HTTP Request” where XMLHTTPRequest reads like a random string until the last word. Javascript uses XMLHttpRequest which is maybe the worst of both worlds. if i remember correctly, microsoft has a naming convention that is approximately: “Only capitalize each letter if the abbreviation/acronym length is 2 or less.” … but they are also the ones that implemented XMLHttpRequest neofox_googly_shocked

2
0
3

eli, vampire kitsune

Edited 8 months ago

@Shivaekul @kasdeya i think even microsoft’s proposed convention isn’t that good. would Filesystem ID become FSID? this seems like a 4 letter acronym instead of two 2-letter abbreviations

not to mention the (small, but still present) cognitive load of needing to remember to change the convention depending on the length of the abbreviation

0
0
3

@rowan @kasdeya Oh cool! Yeah, I definitely see ID all over the place even outside of coding. I think it has mostly just been recently, where I use a language (common lisp) where the coding convention is lowercase, that I've started using id, and now that it doesn't look weird, I think it is actually the correct option.

Yeah, I really like camel case out of those options; XMLHttpRequest caused me pain. And the allcaps version here (and that you added in another reply) both blend together way too much for me. I think it is more important to distinguish between "words" than almost anything else.

0
0
2