pcg-cpp
pcg-cpp copied to clipboard
Prefer composition over inheritance.
Inheritance is often a code smell. Composition is usually cleaner.
Porting the full code to a language without templates was painfully difficult.
The least concern was that sometimes the names from the template parameters is used, whereas sometimes the typedef/constant in the class was used. To avoid, consider prefixing all template parameters with a _
.
The mixins were bad enough (especially since some have extra functions, like unoutput
), but inside_out
and extended
were atrocious. The frequent reliance on mutable references didn't help either.
Oh, and pointlessly-overloaded functions.
Porting the full code to a language without templates was painfully difficult
@o11c Did you succeed? Linky?