Re:Post-Architecture: Premature Abstraction Is the Root of A...
by sqeaky on Thursday July 18, 2024 @01:53PM
(#40998118)
Even in C++ the last time I thought I might need inheritance I made a simple class/struct with a few members that were `std::function` instances. Instead of needing inheritance this worked and I managed to keep type safety checks on all function return and parameter types. Once upon a time this would have been weird function pointers and `void*` with dangerous casts. Last month when I did it, there were just lambdas passed to typesafe constructors.
[ Parent
| on HN ]
There are no comments on this comment yet.