💾 Archived View for bbs.geminispace.org › u › Addison › 4710 captured on 2023-09-08 at 18:36:07. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Re: "Any C# fans in the crowd? I have a large legacy C# codebase..."
I use it all the time, for work and personal stuff. I wrote a Gemini client called Opal in C#, and Rosy Crow is made with .NET MAUI.
I may or may not have also built a Gemini mirror of The Anarchist Library using C#, which currently runs on a Linux VPS.
In my opinion, it's perfectly performant for a general-purpose GC'd language; moreso than others, depending on the use-case. .NET 6 and 7 have brought a ton of excellent performance optimizations.
If I absolutely need something to be written in C I'll use C; but for 99% of what I do, C# is the ideal tool because it's what I'm most familiar with.
Regarding IDEs, I use Visual Studio 2022 with Vim keybindings and the ReSharper extension.
As with any set of tools, there are some gotchas to be mindful of, but I don't feel that .NET has more than other languages. ReSharper offers static analysis that will highlight most of the typical coding mistakes as you type them, and will often offer to fix those mistakes for you. I think Rider even comes with ReSharper baked-in, since they're from the same vendor.
2023-08-24 · 2 weeks ago
I use Code (with the C# extension of course) and the dotnet CLI to do the things one normally uses VS for (things like scaffolding of new projects), and the LSP crashes very often and struggles with big projects. Regarding elegance - maybe I can see the elegance you see, but I also find it hard to finish a big refactoring project without leaving any traces of the old code. For example, I don't have a linter for things like x.AddRange(IQueryable) from async code. In general find the type system a bit meh, because I miss Go interfaces and it's static typing but with null and potential gotchas at runtime: more "static" than Python+annotations or TypeScript but less "static" than Go.
2023-08-25 · 2 weeks ago
I'll agree there. The second C# supported nullables, I turned that on but its going to take years for all supporting libraries before it is universal (I hope). With old projects, you can only do that one file at a time.
I like to think newer languages learn from previous ones and NULL will continue to be pushed down.
Refactoring legacy code bases is a pain, more so when the previous team didn't have discipline or a good architecture. That is one reason I'm strict with code reviews.
I inherited a 600 kLOC project (C#, 1.1 MLOC total including SQL Server) twelve years ago and I'm still refactoring out "just make it work" code. It's a painful journey, no matter what language.
If you can, I would strong suggest you try out Rider though. Once you get over the learning curve, it has superior refactoring, analysis, and navigation tools.
Any C# fans in the crowd? I have a large legacy C# codebase at work, and I don't like this language. I feel like this language makes it easy to shoot yourself in the foot, or write code that performs badly and doesn't scale (especially EF+LINQ). And, I find it hard to refactor C# code because of hidden control flow, colored functions (async/not/static/dynamic), 'hidden code' like getters and frequent disruptive changes (across runtime/EF versions). However, some people love it to death and I'd...