4 ms·
Kinda amusing how the following section is complicated by the language's casing-based visibility feature https://google.github.io/styleguide/go/decisions#initi
by frou_dh 4y ago
Kinda amusing how the following section is complicated by the language's casing-based visibility feature
https://google.github.io/styleguide/go/decisions#initialisms https://google.github.io/styleguide/go/decisions#initialisms
- watt 4y agoIndeed, this is one Go convention that I strongly dislike. Java did have that approach once (HTMLDOMURIReference, XMLIDREF and the likes) but they learned their lesson. And what's the basis of capitalizing D in ID?
- Joker_vD 4y agoBecause "ID" is short for "Identification Datum".
- benji-york 4y agocitation needed
- icedchai 4y agoIt is commonly abbreviated that way in normal life (see https://en.wikipedia.org/wiki/Identity_document https://en.wikipedia.org/wiki/Identity_document ) When I see "Id" in code, I wince.
- euroderf 4y agoRage. Raging Id.
- benji-york 4y agoI also dislike "ID" vs "id" (as short for "identity"), but there is some case for it. The below are from Webster's Third New International Dictionary Unabridged. First, the case for "id": id abbreviation 1 [Latin idem] the same Now for "ID" ID noun, plural ID's or IDs [REVISED] [identification] 1 a : documentation bearing identifying information
- euroderf 4y agoAnd "Id" is that Freudian thang, not quite the same as identification.
- toastal 4y agoI like this. Generally speaking, information is not lost in this form—as in form does not change for initialisms. We have the casing on purpose in English to communicate that you are looking at an initialism or abbreviation so why would you lose that to change in variable names? Obviously there are some cases this doesn’t work as many languages variable names need to start with a lowercase letter, hence the need for the section.
- Ferret7446 4y agoIn practice it's not an issue and is quite sensible/intuitive how it works, at least for English speakers.