3 ms·
Why would you think struct and interface should be treated the same? To me the fact a struct can implement multiple interfaces means they are not on the same "l
by yegle 9y ago
Why would you think struct and interface should be treated the same? To me the fact a struct can implement multiple interfaces means they are not on the same "layer" of abstraction.
- hota_mazi 9y agoImagine a struct with functions that don't have an implementation: that's an interface. If it has some implementations and some without, it's an interface with default implementations. See how Kotlin does it, it's really nice and consistent, and you never need to agonize over the decision of picking a class or a struct.