What's the most idiomatic way to create a configur...
# getting-started
j
What's the most idiomatic way to create a configuration class? I could use a simple data class:
Copy code
data class Config(val option1: Any, val option2: Any)

Config(
    option1 = ...,
    option2 = ...,
)
But Ktor prefers to use class-like functions, with a lambda coupled to a builder receiver:
Copy code
Json {
    prettyPrint = true
    isLenient = true
}
What is recommended? Maybe the Ktor approach is more future-proof?
e
it's difficult to make ABI-compatible changes to a data class, so if that is a concern, use the builder pattern
👍 1
j
Yep, that’s probably what I’m gonna do, thank you 🙂