Live data from Hacker News

The Case for C# and .NET

chrlschn.medium.com

111–120 of 376 posts

Re: The Case for C# and .NET

#111

This thread shows there is still a large amount of FUD around .NET and it’s community. Folks here still think it’s Windows-only and comparable to Java. Yet latest TechEmpower benchmarks shows .net running on Linux and being faster than Go, Python, Node, and Rust.

Until Microsoft can match the dev experience of writing front and backend in typescript with pnpm, I’m not touching the dotnet/nuget cli(s) with a 10-ft poll. If you want to write C# just write go

Re: The Case for C# and .NET

#112

Earlier quoted context omitted.

Python, Ruby.

Obviously there is some degree of subjectivity as what a given language's competitors are. In some sense all languages compete with one another but I do think there is some natural clumping of languages/ecosystems. In my view Python and Ruby are not natural competitors to C# as they are dynamically typed and (in Python's case) interpreted. Similarly Rust, C, and C++ are not natural competitors to C# as they do not ha…

This obsession of dynamically typing vs static typing is not useful. ASP.net is used to develop web applications. C# does have better performance than Python, but I highly doubt most applications will ever need or care about that. Choosing C# over Python (or Ruby, JS etc) for performance reasons is premature optimization at best.

Maybe you have some legacy codebase in C# that you need to leverage.

All other reasons to chose C# over something else for web applications seem to lack evidence but certainly not conviction. So yes, Python is a direct competitor to C#, as in there are many more Python web projects out there than C# ASP.net ones.

Re: The Case for C# and .NET

#113
post #92

Earlier quoted context omitted.

I use Rider on my Ubuntu machine and the dev experience for me, is even better than using VS2022 on Windows.

Quoted post unavailable.

VS Code has a C# debugger on Linux. There are certainly limitations to the open source C# support in VS Code, but for students it should be easily sufficient.

If you want a language where not only the core and main libraries are open source, but also all the tools then C# is probably not the right choice. If free (but not open) tools for most use cases and paid tools for larger companies or higher-level demands are okay, then C# fits.

Re: The Case for C# and .NET

#114

I also think that C# and .NET are awesome. Especially latest releases dotnet 6 and upcoming 7 have a ton of new things to be even more productive. I like the fact, that you can develop command line apps, Web APIs, Desktop Apps and smartphone apps all with the same toolset, including the fact that deployment is possible on nearly every major platform for every major platform (except iOS and macOS Apps, as always only…

I tried writing a simple crud api with asp.net, which should parse and respond json. It was the worst development experience I ever had while writing json apis. Validation? Not existent. OpenAPI/swagger documentation generation? Not existent. Then it also tried to force me into using MVC, while acting that it is express with its middlewares. I switched back to node.js with fastify and wrote my app in an hour. I reall…

Well, while I understand, what you are trying to say (a simple crud web api should be easy to accomplish), I think that you were just overwhelmed by amount of possibilities, tutorials and outdated information, because C# / .NET is evolving fast.

That said, you may take a look at my small very early state pet project `tonehub`[1], which can be seen as pretty modern CRUD Web API in 2022, utilizing swashbuckle for OpenAPI, JsonApiDotNet for CRUD, Entity Framework 6 for Database, HostedServices for background tasks and some other nice concepts (DI / IoC, Options Pattern, FileStreams, etc.). I could also use SignalR for WebSockets / Realtime, integrated OpenID/OAUTH2 Authentication, FluentValidation for validation, Api Versioning and much more.

I've never accompilished something like this with this small amount of code...

[1] https://github.com/sandreas/tonehub

Re: The Case for C# and .NET

#115

The article makes a case against using Node.js but doesn't bother to provide a comparison of C# and its actual competitors: Java and Go.

Python, Ruby.

Those don't really compete with C#, except in the most generic sense (as is true for all PLs).

Re: The Case for C# and .NET

#116

Until .NET has the equivalent of Zod, I'm not that interested. Being able to write a validation schema and deriving types from it automatically - that I can share on client and server - is just too big an advantage.

Perhaps you should look into the .NET implementation of gRPC. It works really well in my experience.

Re: The Case for C# and .NET

#117

Earlier quoted context omitted.

Quoted post unavailable.

VS Code has a C# debugger on Linux. There are certainly limitations to the open source C# support in VS Code, but for students it should be easily sufficient. If you want a language where not only the core and main libraries are open source, but also all the tools then C# is probably not the right choice. If free (but not open) tools for most use cases and paid tools for larger companies or higher-level demands are o…

OmniSharp (VS Code extension for C#) has been discontinued and there is no replacement yet. Besides, Microsoft purpusefully sabotaged OmniSharp to make it so unusable that it forces people to use Visual Studio, so even if a beginner on Linux would decide to try C# with a discontinued product they would only face difficulties and a basically horrendous mostly broken experience. .NET on Linux is non existent without Rider and there is no way to sugarcoat this fact. It's sad how ignorant some people are about this and keep peddling untruths about C# that it is well supported on Linux when it isn't.

Re: The Case for C# and .NET

#118

Reading this post, it seems like the author never tried Typescript which seems to be heavily influenced by C#. I hate JavaScript as a language, but Typescript is very palatable. Like it or not JavaScript and Typescript are the franca lingua of programming for now

The author specifically mentions TypeScript. But it doesn't do anything about the dependency problem, nor the performance. And it can only patch over JS flaws so much, since the runtime and stdlib are still whatever the ES spec says they are.

Re: The Case for C# and .NET

#119

I also think that C# and .NET are awesome. Especially latest releases dotnet 6 and upcoming 7 have a ton of new things to be even more productive. I like the fact, that you can develop command line apps, Web APIs, Desktop Apps and smartphone apps all with the same toolset, including the fact that deployment is possible on nearly every major platform for every major platform (except iOS and macOS Apps, as always only…

I tried writing a simple crud api with asp.net, which should parse and respond json. It was the worst development experience I ever had while writing json apis. Validation? Not existent. OpenAPI/swagger documentation generation? Not existent. Then it also tried to force me into using MVC, while acting that it is express with its middlewares. I switched back to node.js with fastify and wrote my app in an hour. I reall…

I think that's the barrier with C# in general - the framework nature of it means there's a lot of "I don't know what I don't know" especially with ASP.NET which is quite large in scope. Don't get me wrong - that's the usual dev reaction when switching from their familiar language/tools to a new one but I don't think, at least historically, C#/ASP.NET made it as easy as it could of been. Which namespace do I open to import the right extension method to register swagger generation? How do I configure it? All that stuff IS existent actually and having worked with both in my current role the .NET version eventually ends up being a "just works" experience. Its just hard to approach and integrate if you don't already know the "patterns" and the libraries. Sadly there's a lot to learn compared to say Fastify for a basic working app. However it is very configurable and flexible. I've seen the same reaction from dev's to the Spring Framework as well - its just feels bloated for a lack of a better term to people coming from JS.

As per another comment after having seen JS devs switch to F# for very large professional application and not wanting to go back I feel its fine for web. YMMV.

Re: The Case for C# and .NET

#120
post #52

Earlier quoted context omitted.

> Blazor is in development and will only get better. How good can it get though? Blazor WASM suffers from the huge initial, multi-megabyte download of the .NET runtime. How is that expected to come down to something in the range of 50-500kb what we have with most JS frameworks now? I just cannot do that on public-facing parts of an application. It is unusable when accessed from a slow mobile network. Company-internal…

While the total download size is unlikely to go below 2MB with Blazor due to .NET Framework binaries, they are working hard on AOT and binary stripping, meaning your app could consist of a base framework download, served from a CDN, and subsequently cached, and a small app specific library that's comparable to a bundled JS lib in size.

>...served from a CDN, and subsequently cached

Due to cache partioning in browsers now, this will still be a big issue for all clients. Don't also forget that many clients are in poor internet speed zones.

A 2MB "buy in" will be unacceptably high for lots of projects (but not all, obviously).

Post reply on HN