A bit late to reply here but that was not what I was saying. I was merely saying that all features can be abused, there is nothing wrong with extension methods per se. but they can be abused, just like inheritance, generics, lambdas etc. I was also pointing out that your agrument against extension methods with "you cant see what they do" also applies to other methods too. so thats not really a valid argument IMO.
R
Roger Alsing
@Roger Alsing
Posts
-
Extension Methods - Satan's favourite construct (controversial to nerds) -
Extension Methods - Satan's favourite construct (controversial to nerds)>>What happens if an exception is thrown during iteration? You can't tell - depends on what the extension method does. Oh please. You can't see that when calling "normal" methods either. So you just put everything in one big god-method so you can see everything directly? You have the same intellisense, the same goto-definition etc on extension methods as on any other method. Abusing extension methods on System.Object etc is bad, but I fail to see how they are bad when used as intended. I've seen developers abuse other features like inheritance etc: public class Order : Address making order inherit address just because orders have a shipping address etc. Bad coders write bad code..