There is still no official answer on how domain na...
# codingconventions
d
There is still no official answer on how domain names with hyphens should be converted to package names. The "Java-way" of using underscores now triggers a code-style warning. 😞
g
underscores for enum and constants should work
but not for top level
val
Looks like this one fixed in 1.2.10
s
The Android Kotlin style guide has a clear rule for this: https://android.github.io/kotlin-guides/style.html#package-names
g
it’s style guide from Google tho
s
It is. 😛
d
That's from Android and nowhere to be found on the official docs. But thanks for the link regardless.
And it also doesn't work in all cases, since multiple domain names map to the same package...
And there is section about property names
and about package name:
Names of packages are always lower case and do not use underscores
d
Well, yes it says not to use underscores. But it does not say what to use instead 😛
g
if you do need to use multiple words, you can either simply concatenate them together [org.example.myproject] or use camel humps (org.example.myProject
d
Thanks, I missed that in my previous research apparently. Is there a reason why multi-word names are discouraged?
s
Yeah, it was from Android, but considering there's no official word from JetBrians yet, that's what I came up with. simple smile That draft was a good find, though! 👍
e
No objective reason as far as I know. The style is a very subjective topic