3 ms·
What advantages does the Golang version have over inheritance? Please, note I don't dispute the "prefer composition over inheritance" thing. In fact, I heartil
by myk9001 3y ago
What advantages does the Golang version have over inheritance?
Please, note I don't dispute the "prefer composition over inheritance" thing. In fact, I heartily agree with it.
But in this specific case, where every sinle detail of Person is publicly exposed in Employee (no pun intended), I don't see a material difference. If anything, the example uses composition as a tool to implement inheritance on top of.
Am I missing something?