After reading this thread and reading an article, frankly, I am starting to get quite frustrated with .Net. They created something powerful and flexible yet simple. The essence of elegance. Then they tack on generics, nullable types, and partial classes. Now we have extenders, lambda expressions, implicit types, object initializers, anonymous types... We are taking C#, throwing in everything bad about VB (dont get mad, VB users, you know it has potential for horrible programming practices), adding the confusion of C++ (dont get mad C++ users, you know that it takes a lot more time to learn and requires a much finer understanding of the language to fully utilize all its features, and Im sure you remember the utter confusion the first time you looked at C++ code), and creating FrakenSharp .Net.
I dont understand extenders. Isnt the idea to inherit a class in order to extend it? And isnt the idea that a sealed class is specifically meant to not be extended? I can see where an extender can be useful, but it looks like we are losing touch with the OOP and managed code virtues that made .Net so great. What is so horrible about creating a function that acts on a specific class without adding the function to that class interface? The extender-free code isnt really any more or less reuasble, is it? We loose the OOP syntax, but extenders arent OOP in the classic sense, are they?
When you call a delegate pointed to a function of an interface implemented by a generic class implicitly typed by object initializers, just what the hell function are you calling? What about when you unwittingly call an extender function and cant find it in the definition of the class that you are calling it for, or any bases of that class. It is like giving a whole new meaning to spaghetti code. All over again we cant tell where program control is coming from or where it is going.
I dont understand extenders. Isnt the idea to inherit a class in order to extend it? And isnt the idea that a sealed class is specifically meant to not be extended? I can see where an extender can be useful, but it looks like we are losing touch with the OOP and managed code virtues that made .Net so great. What is so horrible about creating a function that acts on a specific class without adding the function to that class interface? The extender-free code isnt really any more or less reuasble, is it? We loose the OOP syntax, but extenders arent OOP in the classic sense, are they?
When you call a delegate pointed to a function of an interface implemented by a generic class implicitly typed by object initializers, just what the hell function are you calling? What about when you unwittingly call an extender function and cant find it in the definition of the class that you are calling it for, or any bases of that class. It is like giving a whole new meaning to spaghetti code. All over again we cant tell where program control is coming from or where it is going.