Microsoft’s C# programming language sometimes reminds me of a pinata – it is full of surprises. The latest one comes in the form of the two delegate definitons below:
//DELEGATES
public delegate void doneSearchingDlg();
public delegate void newResultDumbDlg();
doneSearchingDlg doneSearching;
newResultDumbDlg newResultDumb;
In case anybody is new to C#: a delegate is a function pointer which can accumulate multiple functions, which are then all called at once with a single call. But this is not the reason for this little rant – instead, I am pissed about why the declarations cannot look like this:
//DELEGATES - CAN NOT COMPILE AS OF VS2005
public delegate void doneSearchingDlg() doneSearching;
public delegate void newResultDumbDlg() newResultDumb;
In plain-old vanilla C, almost every language primitive can be animated while it is being declared – why this feature was omitted from Delegates is a mystery to me.
Ideas, anyone?
Related posts:






