Colton Idle
07/23/2022, 4:02 AMsealed interface UserType {
object GUEST : UserType
class AUTHENTICATED(
val authToken: String,
) : UserType
}
David Rawson
07/23/2022, 4:40 AMUserType
or just a User
? So will you be writing if (user is Guest) {
or if (user.userType is Guest) {
? Could end up with some redundancy in the name if not careful.ephemient
07/23/2022, 5:55 AMFor enum constants, it's OK to use either uppercase underscore-separated names (screaming snake case) (but the IntelliJ plugin is on the upper camel case side, https://github.com/JetBrains/intellij-community/blob/master/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/inspections/NamingConventionInspections.kt#L208) or upper camel case names, depending on the usage.enum class Color { RED, GREEN }
Colton Idle
07/24/2022, 12:01 AMsealed interface User {
object Guest : User
class Authenticated(
val authToken: String,
) : User
}
makes sense. Thanks all