Coffeehouse Post

Single Post Permalink

View Thread: Why does C# not support this?
  • Maddus Mattus

    Massif said:

    Well what would

     

    var whatAmI = worker.DoWork();

     

    Do? and of course what would:

     

    worker.DoWork();

     

    Do when we don't care about the return?

     

    I also don't like it because it doesn't seem properly polymorphic to me, as the return type is clearly related to what the function does, and now the identically named functions are clearly doing something different. But that's just me.

    I hate var's

     

    they are for lazy programmers Smiley

     

    and worker.DoWork() would not be possible, because DoWork has a return type. Ignoring the return is not 'first class' as Erik would call it Smiley