Live data from Hacker News

The Case for C# and .NET

chrlschn.medium.com

161–170 of 376 posts

Re: The Case for C# and .NET

#161

Earlier quoted context omitted.

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…

FluentValidation and Swashbuckle are two great libraries for the tasks you referenced. This is a good enough reference repository should your curiosity be piqued again in the future: https://github.com/jasontaylordev/CleanArchitecture

Yep. The problem that the parent commenter had is distinguishing between "Not existent" i.e. the tool that I am trying out sucks; and "I don't know how to use this tool yet" - a completely normal part of the learning experience.

Failing to find the differences between them will impede learning in general.

Re: The Case for C# and .NET

#162
post #109

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…

> The sheer amount of concepts in C# is overwhelming Agreed. But F# is one of the best designed languages around.

I don't disagree, and I love F# but I think it owes a lot of that to OCaml. That said, since we're talking about C#, F# and VS Code I'm gonna vent a little about something that arises when you use all three :D

If you open a C# project in VS Code when the "Ionide" extension (basically the F# extension for VS Code) is installed then the extension thinks it's a F# project and will open some F# stuff after a few seconds (or prompt you to setup some F# stuff in its gitignore). The root cause has been identified (plugin activates when it sees a ".sln" file), a PR has been opened and rejected with no mention as to why (https://github.com/ionide/ionide-vscode-fsharp/pull/1401) and the developers behind it are frustratingly non-communicative about it, closing issues about it (https://github.com/ionide/ionide-vscode-fsharp/issues/1701), they're not present in the discussion (https://github.com/ionide/ionide-vscode-fsharp/discussions/1...). Usual rules about OSS maintainers apply, they don't technically owe us users anything, we should be patient and respectful etc ... but man it is truly bizarre to be ignored or ghosted like this.

Re: The Case for C# and .NET

#163

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…

> that the official repo can only "unlist" packages, not delete them or that the publish times sometimes have horrible delays

It's to avoid the npm left-pad problem. nuget.org packages are idempotent.

For the publish times, I found out you can cut it in more than half if you tell nuget to ignore caches.

Re: The Case for C# and .NET

#164
post #5

> For the front-end, JavaScript is unavoidable (for now) Author really needs to give Blazor a try. I wrote some comments last week speculating that I'd use Dart or TypeScript with C# .NET on the client because WebAssembly doesn't do DOM manipulation, but turns out I should have waited to learn it better before making a comment. I've learned I can add events and event handlers to elements without ever leaving C#. Then…

I was really excited for Blazor, until I tried developing for it. The DX is not really there yet and in the mean time I stumbled up HTMX (https://htmx.org/) and now I'm having an even harder time being excited for Blazor. And don't get me started on Blazor Server vs Blazor WASM...

The thing is, Blazor will become the lingua franca of (web) UI development for bigcorps, so I just need to suck it up and learn it (I'm a .NET consultant geared towards finance & insurance)

Re: The Case for C# and .NET

#165

Earlier quoted context omitted.

How are collections in C# worse than in Go? In C# you have LINQ, in Go you're writing for loops around array slices.

Maybe I was using it wrong? As I recall, "the usual" APIs present in most other OO languages were not available when I tried to help a friend with a project 3 montjs ago.

Which APIs were those?

Re: The Case for C# and .NET

#166

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.

.NET core can run on any platform it wants, but as long as it's from Microsoft, the company as we know it, I won't even write "Hello, World!" with it.

A language can't be the fastest at everything in today's mature language ecosystem. OTOH, Debian's "Programming Language Games" benchmarks shows it's on par with Java (which is not slow in any means), and not as fast as you claim [0].

In the page I shared, some C# benchmarks are impressively fast, because they are written with explicit hand crafted SSE3/AVX vectors, which a run of the mill programmer won't want to touch (for most of the time, anyway).

Comparing .NET Core, which is a hybrid JIT language with purely interpreted ones like NodeJS and Python also makes no sense at all, considering Python Compiler does not do any optimizations whatsoever, and is still confined to a single core per process unless you pull some tricks.

Choosing horses for courses is fine, and we all shall do it, but claiming a language as winner over a single benchmark suite, including the one I referenced is wrong.

Choose what works best for you.

[0]: https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Re: The Case for C# and .NET

#167
post #47

Earlier quoted context omitted.

Maybe it's good to have an open ecosystem for using the language that doesn't rely on paying for an IDE? I personally soured on Kotlin for this same reason!

Why do people feel they are absoultely entitled to having best-in-class IDEs for free? Don't the developers of those IDEs have the right to, you know, eat ? ALso, JetBrains' IDEs are: - free for students, startups and opensource projects - cost an insane "two/three beers a month" for individual licenses (yeah, it's more expensive than two beers in many countries, but as a developer I could easily afford it even in th…

I'm not entitled to a best-in-class IDE experience, I'm just happy using one of the dozens of equivalent languages that do have them with an open community.

Re: The Case for C# and .NET

#168

This seems more like Yet Another Medium Article shooting fish in a barrel by describing problems with the JS ecosystem rather than an actual case for C# and .NET.

> This seems more like Yet Another Medium Article shooting fish in a barrel by describing problems with the JS ecosystem rather than an actual case for C# and .NET.

It's the very definition of blog spam.

Re: The Case for C# and .NET

#169
post #123

Earlier quoted context omitted.

The dev experience is Windows only, STILL: https://news.ycombinator.com/reply?id=32220935&goto=item%3Fi... (Also the benchmarks are a cheat, look at the source code of C# vs the source code of Go or Java)

Every benchmark is a cheat and not a real-world problem. I also thought their benchmark is a cheat. But it is not. It is testing exactly what the benchmark was testing in that scenario. That is why TechEmpower Benchmark suite is so powerful. It uses different web server scenarios (connection, JSON parsing, database connections, ...). The different test case implementation .NET and others have are making sure no other…

So, either way, the benchmark is not an apples-to-apples comparison between frameworks?

Re: The Case for C# and .NET

#170

Earlier quoted context omitted.

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 for swagger documentation you install the swashbuckle nuget package and then add these three lines services.AddSwaggerGen(); app.UseSwagger(); app.UseSwaggerUI();

Personally, I'd rather generate documentation at compile time.
Post reply on HN