4

C#

Lately there have been a lot of new features for the language itself, and I fear that a lot of them make the language more and more convoluted.

Also AoT Compilation should be pushed more, but that might just be my opinion.

Comments
  • 1
    Tbh I still don't get default interface implementations from c# 8.
  • 1
    It needs more. What I miss most is that C# doesn't have tagged unions (more advanced enums). They can really compose very well with pattern matching.
  • 0
    @craig939393 it's multiple inheritance but not really
    I find them weird too
  • 1
    @Geoxion literally why
    Just keep a language simple I beg you

    C++ has gone down this rabbit hole it's an utter mess
  • 0
    @LotsOfCaffeine that is true. But since its inception, most new features skew to the functional style of programming.

    I'm not very versed in functional programming yet (got into it with Rust), but I believe monads are quite important. With tagged unions you can easily make Option, Result and Either types which unlocks a boatload of extra functionality.

    But yeah, it's always a balance
  • 0
    @Geoxion Option types? As in optional?

    so some container that either has a valid value or doesn't?
  • 0
    @LotsOfCaffeine yes, but most importantly, you can only get to the value of you pattern match on it. This forces you to deal with the possibility that there may not be a value.
    This can greatly reduce the amount of bugs in programs
  • 0
    @Geoxion that already exists, it's called null.

    And with C#8 you can have compiler warnings/errors if you miss something
    I think that was called Nullable Reference Types
  • 1
    @LotsOfCaffeine it's not the same. Null can only be used with references. So no primitives or structs unless you make them nullable.

    But yeah, C#8 does help with this, but that still leaves the other possible types be awkward and inefficient to implement.

    These types are also not the only things you can do with it of course.
  • 0
    @Geoxion you can make value types nullable, which just means they get boxed

    Should be the same syntax in C# as well

    int? a = null;

    Should be valid iirc
  • 0
    @Geoxion I have seen the functional borrowing in C# as well. It is like the team is trying to make C# act more like TypeScript. Especially with var and other things that let you circumvent typing an object type. Which is the whole reason to use typescript or an OOP language.

    I feel that well typed Typescript is much nicer to work with than C#. Unfortunately most developers suck at self discipline so any options that allow people to cobble stuff together result in cobbled together code.
  • 0
    @irene I think var has existed in C# for ages now
    I don't like using it all too often, only when the type names get stupidly long.
  • 0
    @LotsOfCaffeine var has been around for a long time but it was definitely borrowed from Implicitly typed languages. I see a move to making things more implicit.
  • 0
    Like what? I am new to C#
Add Comment