Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Geoxion9014yIt 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.
-
@Geoxion literally why
Just keep a language simple I beg you
C++ has gone down this rabbit hole it's an utter mess -
Geoxion9014y@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 -
-
Geoxion9014y@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 -
@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 -
Geoxion9014y@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. -
@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 -
irene33914y@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. -
@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. -
irene33914y@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.
Related Rants
-
InvisibleMe21"Pythonists don't comment, they write readable code." Yea, tell that to the list comprehension with three lam...
-
ddash1237The best motivation to quit Image Classification... x_x
-
NoMad8Assembly... Do I really need to say more? Okay, it's low level so there is no abstraction. All you deal with ...
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.
rant
wk239