https://kotlinlang.org logo
#compose
Title
# compose
g

Gabriel Feo

04/29/2020, 11:25 PM
Just out of curiosity, is it a convention from somewhere to name constants in UpperCamelCase? This is from
Constraints2
I think I like it
z

Zach Klippenstein (he/him) [MOD]

04/29/2020, 11:28 PM
I believe the Kotlin style guide recommends either this style or SCREAMING_SNAKE_CASE, but the Android-specific kotlin style guide narrows that down to just screaming snake.
g

Gabriel Feo

04/29/2020, 11:29 PM
Lol that name pretty much describes my discomfort with naming constants
a

Adam Powell

04/29/2020, 11:59 PM
Yeah we've been doing this across compose and will likely update the Android kotlin style guide to match. It doesn't make much sense to have SNAKE_CASE for some "constants" when you also have
object
and sealed classes where some members are
object
👍 3
Or a top level
val
initialized as an expression vs a top level
object
m

mzgreen

04/30/2020, 5:02 AM
Will we get classes named like Constraints2 at launch? Or do you plan to clean this up in the future?
a

Adam Powell

04/30/2020, 5:20 AM
Nah those will replace the old ones and get renamed. The nice thing about pre-alpha releases is we can break APIs with abandon 😁
😂 1
Mostly we're trying to use the kotlin deprecated/replaceWith facilities to make keeping up with the changes easier. Our first few releases were pretty rough so we're trying to do better gradual migrations
But since we do our own CI with warnings as errors, if we deprecate we have to also migrate our whole codebase at the same time. Good and realistic incentive but it takes a little time
m

mzgreen

04/30/2020, 6:19 AM
Yeah makes sense, thank you 🙂