Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Delegate madness

Name: Anonymous 2010-07-25 22:34

I've been studying C# for a while and this feature (along with events) just depresses me.

All this could've been much more elegant with first class functions.

I thought C# wasn't that bad, but they lost me here.

WHAT DO YOU THINK?

Name: Anonymous 2010-07-25 22:44

You haven't studied C#. There are first class functions, they're called lambdas.

Name: Anonymous 2010-07-25 22:48

>>2
Lambdas are enough for you? They aren't for me.

Name: Anonymous 2010-07-25 22:54

What exactly is hard about delegates and events? Delegates are just function pointers with static typing, events are just lists of delegates that are called when the event is fired from within it's parent class. If you can't understand this you should rethink your career direction.

Name: Anonymous 2010-07-25 22:57

>>4
Aren't delegates the lists of function pointer?

Name: Anonymous 2010-07-25 22:57

>>3
Does that even matter? Your initial assertion was that it could've been more elegant with first class functions (the wording of this assumes that there aren't). It doesn't matter if the first class functions are enough, they're there. Thus, your initial assertion is wrong.

Name: Anonymous 2010-07-25 23:00

>>5
Technically delegates support multiple function pointers. When called these delegates will execute every attached method and return the result of the last one. I've never seen this used in practice and it is regarded as extremely bad style, as this is what events are there for.

Name: Anonymous 2010-07-25 23:14

You should've seen this coming, /prog/:

DELEGATE MY ANUS!

Name: Anonymous 2010-07-25 23:27

>>8
Gladly. *grabs dick*

Name: Anonymous 2010-07-26 0:47

Quack.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List