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.
You can follow @dsymetweets.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: