Hacker News new | ask | show | jobs
by lmm 1711 days ago
> Sounds like you’re describing something like C.

Not at all. C has essentially no support for interfaces or polymorphism, yet alone delegation - even its data structure support is wonky (no real sum types). If C++ classes are "all you have is a hammer", C doesn't even give you the hammer, so you end up bashing screws in with a rock.

What I advocate is something like Rust, where you have both structs and traits as distinct concepts that serve separate purposes.