Journey into C#
Being a moderatly to quite skilled programmer since 15 years, the past four years PHP exclusive, I have for various reasons decided to take up C#. This blog is for sharing my ups and downs with fellow C# coders, beginners and pros alike.
söndag, augusti 08, 2004
 
My thoughts on delegates
The more I read the more I learn about exciting new concepts in C#. One of these concepts is delegates. In short, IIRC, delegates are unique to C# and is a way of referencing methods allowing for your code to apply these methods from within another method, even though the metod referenced otherwise might be hidden from the particular method referencing it.

Wow, that was easy to follow wasn't it?

Anyhow, delegates are quite useful and helps immensely in many situations. There is this one thing that irks me though. As Simon Robinson puts it:
With classes there are two distinct terms - 'class', which indicates the broader definition, and 'object' which means an instance of the class. Unfortunately with delegates there is only the one term. When you create an instance of a delegate, what you have created is also referred to as 'a delegate'.
How hard could it have been to come up with two terms? I say we help Microsoft out here and create the other term for them.

My thinking here is that 'delegate' should be analogous to 'object' so what we need is a term analogous to 'class', but for delegates. But that's just my view on things, perhaps there is a good term for an instance of a delegate?

Comments: Skicka en kommentar

<< Home

Powered by Blogger