4 ms·
Also, creating a subclass just to add extension methods is definitely boiler plate. Util classes too, though they are useful for packaging functions at least.
by rogerkeays 3y ago
Also, creating a subclass just to add extension methods is definitely boiler plate. Util classes too, though they are useful for packaging functions at least.
- kaba0 3y agoSubclassing may not always be possible (final class, or method) and can break class invariants. Util classes with helper methods and/or extension methods are not prone to these problems.
- rogerkeays 3y agoYes, inheritance is a nightmare!