Comment by nobodyandproud
3 years ago
Yes, done well it adds that benefit and if the extension method is universal to the type then proceed ahead with some caution. LINQ is a great example of this.
Where it falls apart is when it turns out that slightly different behavior is needed based on sub-type.
The right thing is to then move past the extension method, but it's more compelling to take the short-term gains of bolting-on more logic into the extension method.
No comments yet
Contribute on Hacker News ↗