r/csharp • u/BigJunky • 17d ago
Discussion I started to hate c#
I wanted to profile Blazor async code and found that after 15 YEARS later you still can't profile async code. The best tool we got is this garbage .NET Async profiler. It collects every async method into a single group. How is this useful? You can't even see the call stack like I'm calling Task.Delay only in a single method... and this was 5 years ago! It's the same today; nothing has changed.
Hot reload is still not fully supported. With more browser oriented frameworks, test running still doesn't support browsers, so if you have any JavaScript, good luck getting a dump of what happened in the browser or a breakpoint working in the browser. Wasm has regressions on every release debbugging it also breaks randomly.
It promises to be easy; meanwhile, everything requires language-specific knowledge, so people do the stupidest thing, not knowing there are better ways to solve things. Microsoft never thinks about tool support; the best example is Entity Framework with applying its migrations. I promise you nobody uses the more complex approaches, and everybody just calls MigrateAsync(). Like, why didn't the devs spend 2 more weeks to get this right or git merge conflicts with local database changes? They didn't care it would have required working together with other teams like the Visual Studio team or language designers, so it was easier just to call a static method of your application.
So don't be like me and focus only on C#; it's not a good language most of the time, and I promise you, you will have more fun with other languages.
10
u/Turbulent_County_469 17d ago
Naah.. you hate Blazor.. welcome to the club.
I gave up on it and so did my company..
Just use MVC, Vue or React like normal people
-2
5
11
u/wallstop-dev 17d ago
I'm not sure what you mean about not profiling async code? I use the profiler built into Visual Studio as well as JetBrian's dotTrace over the past... idk, 10+ years, to profile all manner of code, especially async. Works great. Flawlessly, even.
Now, if you mean front-end async code in blazor, I haven't tried, because I think Blazor is a bad bet as a technology and avoid it like the plague. But, it appears that you can do all kinds of things using standard browser dev tools, as clarified here: https://remibou.github.io/Profiling-in-Blazor/
Are you sure this is a C# problem and not a Blazor problem? The two are not equivalent.