The original thread is on the devilās website and I donāt want to direct traffic to it, so hereās a link to the tweet instead:
https://twitter.com/davidfowl/status/1671351948640129024?s=46&t=OEG0fcSTxko2ppiL47BW1Q
Type system rigidity, I started using TypeScript a lot over the last few years with FE work. TS is so much more flexible and expressive. I really wish that I could express constraints in C# as fluently as I can in TS
Enums really need more flexibility, unions, discriminated unions, left hand implicit type, better value supportā¦etc
System.Text.Json still sucks, itās not greedy, no global setting , non-sane default,no expando supportā¦etc itās awful to use.
Unstructured data in general is an absolute pain to work with.
Composability of tests is still super painful and verbose. Dynamic test generation is awkward and unergonomic. After doing testing and other languages that let you simply compose tests imperatively, C# testing is definitely painful.
IMHO C# is an acceptable language with an absolutely fantastic framework.
I love C#, but these are my primary gripes
A Lemmy post that contains a tweet that contains a Reddit comment. Quite a ride.
Well, like most people who havenāt used .NET, I have very strong opinions about it.
The first and main issue I take with it is how itās all capitalised. Second but not less, itās such a generic name. Am I gonna get websites in the .net domain or do I have to learn Google search beyond typing random junk, pressing enter, and hoping for a stackoverflow answer that works?
Youāll eventually get used to different casing conventions in different languages thatās just something that you have to mature into.
Depending on the language you are writing the conventions will be different, itās often within your best interests to adopt to those conventions instead of trying to fight against them.
The things I bump in the most:
- Mutability. Everything is passed by ref so imutable and/or copy should be an important factor of the language, but itās not. Struct vs class also was way to much impact but can both be used for an interface argument but have such different flow.
- Compatibility is always favored over improvement in the framework design and language. It has obvious pros as we need less porting, but newer functions in the language are often weird to work with and frameworks get replaced instead of improved, making the porting even harder.
- A lot of features work magically simple until you want some kind of custom behavior and they then become unmanageable complex. Like the default XML serializer where you can do no extension and everything can get serialized, or async function that abstract the threading untill you want to manage multiple parallel function with error checking and you get very weird and confusing code. Thay all work magically easy as long as you use them for nothing more difficult than the examples.
Dotnet had really been the ecosystem i keep coming back to. Itās been so frictionless. It could be experience, but I really never feel like Iām fighting with it. Running plain C might be the only other ecosystem that I would hold as a less frictionless experience. I genuinely donāt hold any frustrations with it. I donāt have any ideological problems around Microsoftās involvement. The tool lets me solve problems effectively.
The only thing Im missing is a good llvm target for the clr something like what the kotlin native guys enjoy so i can take the ecosystems to new places.
Sure EFcore can be tiresome and LINQ is inefficiĆ«nt. But Iām going to be honest here. If youāre trying to squeeze performance out of an ORM and youāre running up against performance limits of LINQ, maybe not use a time-saving tool as a power tool?
Maybe Iām simping a bit over it, but Iām not seeing alot of positive content about a tool that has only been very productive in my experience. Maybe because all of the dotnet users are too busy solving actual problems for people haha š
Oh and newtonsoftā¦ And maybe xUnit and nUnit could make up and figure out a way to be ergonomic AND work well multi-threaded.
Performance limits of LINQā¦?
Youāre getting nearly the same performance out of loopes generated by LINQ as you would normal for loops.
If youāre referring to LINQ and EF Core, youāre generation SQL with it, not running LINQ. And that query generation is incredibly performant these days (I think EF 7 was something like 5% slower than dapper?).
So luckily you can squeeze a ton of performance out of it!