Coffeehouse Post

Single Post Permalink

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

    vault said:
    Maddus Mattus said:
    *snip*

    I used to think so too, but after programming in Visual Basic properly, less is more.

     

    In C# you have

     

    MyClass myClass = new MyClass

     

    Whereas in VB you have

     

    Dim MyClass = As New MyClass

     

    which is elegant, notwithstanding the 'Dim' keyword of course - what a tragedy

     

    var myClass = new MyClass

     

    results in far less code, and is infinitely more readable in the long run, especially with long namespaces and properly formatted Linq queries. 

    Oops, wrongemail address

     

    I used to think so too, but after programming in Visual Basic properly, less is more.

     

    In C# you have 


    MyClass myClass = new MyClass

     

    Whereas in VB you have 


    Dim MyClass = As New MyClass

     

    which is elegant, notwithstanding the 'Dim' keyword of course - what a tragedy 


    var myClass = new MyClass

     

    results in far less code, and is infinitely more readable in the long run, especially with long namespaces and properly formatted Linq queries.