`[Question]` -> In kotlin the correct thing is ...
# android
m
[Question]
-> In kotlin the correct thing is to use ID or Id ? There are many conventions about this all over the internet, however I haven't found a rule or pattern that is directly applied in kotlin. There are projects that follow both formats. And we know this can be something very personal. However, according to the whole structure where Kotlin was constituted. What would be the correct standard for these nomenclatures? Is there in fact any real guidelines?
👀 1
l
Not strictly a Kotlin guideline, but generally, the Android guideline says to treat common acronyms as words (so you'd have a HttpXmlUsbId if those words made any sense together)
e
according to that source,
When using an acronym as part of a declaration name, capitalize it if it consists of two letters (
IOStream
); capitalize only the first letter if it is longer (
XmlFormatter
,
HttpInputStream
).
l
The two letter exception in the Kotlin guideline is interesting. It feels a bit odd to make it different.
s
Androidx libraries dont seem to be 100% consistent on this -
RxWorker
, `ICUCompat,
Dp
etc.`