Build with an Azure free account. Get USD200 credit for 30 days and 12 months of free services.

Start free today

C# Language Highlights: Target Typed new expressions

Play C# Language Highlights: Target Typed new expressions

The Discussion

  • User profile image
    RichardR
    True, target-typed new expressions will save you some keystrokes. But, is that really a wise choice for when you are reading the code 6 months, or 3 years from now? Or reading code someone else initially wrote? Having the type explicated stated in the code will probably make reading/understanding the code easier down the road.
  • User profile image
    Eliyahu

    Absolutely agree with RichardR. Also, I don't really appreciate saving on the type name. In case of many line, I will use copy/paste anyway, no typing.

  • User profile image
    jmoralesv

    2 hours ago

    Absolutely agree with RichardR. Also, I don't really appreciate saving on the type name. In case of many line, I will use copy/paste anyway, no typing.



    Both of you forget that the class type name is at the left hand side of the expression in the first example. In the second one, for the list of products, the type is also at the left. So there is no actual problem in the readability of the code.
  • User profile image
    Ilia101
    You are doing everything to convert C# with its maturity into Python garbage. So sad :(

Add Your 2 Cents