My Authors
Read all threads
It's really strange what nonsense people put up with in C#.

This business where expression results are implicitly discarded from statements is just insane in the 21st century. So much information loss just waiting to happen without even a warning.
Other gaping holes in the C# design I've noticed this last week:

- no way to implement interfaces or abstract classes using an expression, meaning stupid extra classes

- no implicit construction for classes (to give another form of closure capture for object imlpementations)
- no expression form for generative list or sequence expressions (making HTML DSLs a mess among other things)

- dynamic is hell waiting to destroy your life
- no consistent API for programming functionally with arrays (you have to resort to LINQ all the time).

- no primitives for delegate composition leads to endless switching between objects and delegates for composition
- No cheap-and-cheerful immutable collection with nice syntax both static and generative (e.g. like lists in F# - which have some issues but are a great workhorse for small quantities of immutable data)
"- no way to implement interfaces or abstract classes using an expression, meaning stupid extra classes"

This one is particularly bad with this "one class per file" nonsense. Really, to implement an interface for some localised logic I need to create a new file? Come on....
Don't take this too seriously by the way

This is just me letting off steam after an intense week working on some C# code - work I've been happy to do and have found satisfying :-)))
I am really happy how much C# has progressed from C# 1.0 to 9.0. And it has many wonderful qualities.

But all of the above are F# 1.0 features, and each are, on their own, critical enough that IMHO no one should program without them.

C# just still has a long way to go....
Another more subtle one

- lvalue capture in delegate closures is really subtle (i.e. outer 'var' can be mutated in closure). There were multiple times this week when I almost inserted a really subtle bug because of this. This deserves a warning too.
I put a quick gist illustrating some of these points here:

gist.github.com/dsyme/32de0d1b…
Missing some Tweet in this thread? You can try to force a refresh.

Keep Current with Don Syme #FreeAndFairElectionsForBelarus

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!