<https://todd.ginsberg.com/post/advent-of-code/201...
# advent-of-code
k
If you have a sealed class with only object implementing it you could make it an enum as well:
Copy code
enum class Foo {
    A {
        override fun execute() = println("A")
    },
    B {
        override fun execute() = println("B")
    };
    
    abstract fun execute()
}
t
Yeah, that's totally true. I just feel like at some point I'll regret this decision and need stateful classes.
k
Yeah it's less flexible.
t
I just get paranoid with these that I'm doing something I'll regret later. Heh.