top | item 45769893

(no title)

LogicHound | 4 months ago

I can't stand modern C#. They've bung in a bunch of new keywords and features that are of dubious benefit every release.

discuss

order

mrsmrtss|4 months ago

I'm interested what are those new keywords and features that are of dubious benefit?

LogicHound|4 months ago

There is a huge amount of syntactic sugar that has been added over the years that doesn't do whole lot IMO. It is often imported from other languages (usually JavaScript and/or Python).

e.g. Just a very simple example to illustrate the point

    if (customer != null)
    {
        customer.Order = GetCurrentOrder();
    }
vs

    if (customer is not null)
    {
        customer.Order = GetCurrentOrder();
    }
Is there really any benefit in adding "is/is not"? I would argue no. So I categorise that as being of "dubious benefit" and there are many similar small features, keywords etc. that get added each release where they might save a few lines of code somewhere but I've never seem them used that often.