in reply to Perl and C# - how I use both

Delegates, also known as dumbed down closures with stupid syntax.

BTW, did they finally do something about the silly

AwfullyLongClassName x = new AwfullyLongClassName();
all over the place? I mean, yeah, sure, at times I may want to have a variable of type A containing from the very beginning a value of type B (subclass of A), but how often? There's no reason to repeat the name of the class if its the same and there never was.

These two and quite a few more made me dislike C# back when I had to use it. Way too talkative, way too repetitive, way too low-level, way too restrict(ive|ed).

Replies are listed 'Best First'.
Re^2: Perl and C# - how I use both
by deliria (Chaplain) on Mar 10, 2009 at 09:16 UTC

    var x = new AwfullyLongClassName();

    These two and quite a few more made me dislike C# back when I had to use it. Way too talkative, way too repetitive, way too low-level, way too restrict(ive|ed).

    It's still pretty much like that. I've been working with C# for about 9 months now (not my choice, but the job pays the bills) and C# is still frustrating me to no end. I expected it to be less frustrating as i got to learn the language, but it doesn't; I still find myself longing for the flexibility and expressiveness that perl offers.

Re^2: Perl and C# - how I use both
by jdrago_999 (Hermit) on Mar 10, 2009 at 17:24 UTC

    Yes - I agree with everything you just said.

    However, compared with the old preferred way of coding on Windows - COM (via Visual Basic or VBScript) - or worse yet, the win32api, C# and the .NET framework is much easier and more predictable.

    Also my experience of being forced to program anything on Windows has always had a single common root: *Somebody* on the team threw a hissy fit until Windows was chosen, and only because they refused to learn how to actually program. Ironically they ended up just copying and pasting code I would write for them anyways. I suppose it was better than if I had to use code that they had written ;)

      Windows has always had a single common root

      I always thought it was a single common C:\.

      And you didn't even know bears could type.

Re^2: Perl and C# - how I use both
by weismat (Friar) on Mar 11, 2009 at 05:36 UTC
    Delegates are type-safe function pointers and they are so useful, because you can exchange them between threads, which is used heavily inside the asynchronous programming model.
    You can create an instance of delegate with a closure.