News for hackers. Stuff that matters.
Re:Inheritance versus Composition by aurelwu on Thursday May 09, 2019 @09:54AM (#19868291)
automatic code generation would be a way to do it without inheritance and not manually needing to implemenet all 20+ methods.
Re:Inheritance versus Composition by nradov on Thursday May 09, 2019 @11:10AM (#19868969)
Code generation tends to result in bloated binaries and excessive runtime memory consumption (unless your compiler is especially clever about optimizing out the redundancies).
Re:Inheritance versus Composition by klntsky on Thursday May 09, 2019 @10:37AM (#19868647)
Yes, but you still need to create a code generator first. If your language of choice allows to do it nicely.
Re:Inheritance versus Composition by marcosdumay on Thursday May 09, 2019 @01:05PM (#19870026)
Automatic code generation is an incredibly effective problem factory.