Noob question, I have a class called EntityUUID. o...
# getting-started
t
Noob question, I have a class called EntityUUID. or should it be EntityUuid?
j
Name it like you want, but keep it consistent across your codebase 🙂
Personally, I would go with
EntityUuid
because if you need to add a suffix it is way more readable. Compare
EntityUUIDSuffix
and
EntityUuidSuffix
and choose what you prefer.
5
👍 1
t
Yeah that makes sense
e
I'd always use titlecase for any words within camelcase names, because Kotlin follows JavaBeans property naming conventions, which leads to
getUUID()
=
val UUID
,
getUuid()
=
val uuid
tl;dr
EntityUuid
👍 1
y
For the future, these questions fit better in #naming
👍 3
g
(I'm too late to this party, but I just can't help myself: every time you capitalize an abbreviation in an identifier, a devil gets its horns.)
🤣 2
k
There are some names from java.net which are inconsistent within themselves, such as
HttpURLConnection
.
a
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
).