Skip to content

Comment on Classes often aren't the simplest tool for the jobparent

Comments

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.