3 ms·
> except throwing OOP into something that doesn't need it I feel like you're jumping to wild conclusions. All I'm suggesting is to change your code to priva
by Tainnor 2y ago
> except throwing OOP into something that doesn't need it
I feel like you're jumping to wild conclusions. All I'm suggesting is to change your code to
private object EUR : Currency
private object USD : Currency
data class Money<C : Currency>(...) { ... }
That's just an empty tag interface and that's not particularly hardcore OOP, you can do the same thing with Haskell typeclasses.