News for hackers. Stuff that matters.
Re:.NET 10 by cebert on Tuesday November 11, 2025 @10:40PM (#45896164)
You can easily use the same types and libraries in your backend and frontend with TypeScript. It’s not at easy with dotnet.
Re:.NET 10 by phito on Wednesday November 12, 2025 @04:29AM (#45898128)
OpenAPI and client generators solve this issue easily.
Re:.NET 10 by littlecranky67 on Wednesday November 12, 2025 @05:20AM (#45898458)
I would love this to be true, but it isn't. I've done generating types for the frontend multiple times, sometimes from C# (around 2016, using typelite), Java (openapi template generator) and most recently straight from OpenAPI spec files (.yaml) using Orval.

It always has been a shitshow. It works well for the 90% cases, but in the 10% edge cases, things break. It becomes impossible to fix generation issues, you will often resort in working around issues in your backend/openapi code. Sometimes you report bugs upstream and hope it gets fixed. In the current project we are stuck on a ~2year old Orval version (a typescript generator from openapi) because some features broke or were removed in the latest version, and the entire monorepo (15+ LoB apps) wouldn't compile and would require major changes. This simply because a never version of the generator was broken/removed features previously present.

Re:.NET 10 by robertlagrant on Wednesday November 12, 2025 @04:34AM (#45898168)
No, that's not true. If you share code like this then you can do things like put the same validation code in the frontend and the backend: frontend to give a nice user experience, and backend to protect the endpoint.
Re:.NET 10 by littlecranky67 on Wednesday November 12, 2025 @05:27AM (#45898510)
OpenAPI does support patterns for fields and nullables/non-nullables - that already gets you very far regarding validation. A decently sophisticated generator (which don't exist IMHO) would generate the validation code for your respective language.
Re:.NET 10 by robertlagrant on Wednesday November 12, 2025 @06:37AM (#45898922)
True, but you can get all the way to zero duplication if you write it directly and share that code.
Re:.NET 10 by josephg on Wednesday November 12, 2025 @04:37AM (#45898181)
Still more work than just running the same code everywhere.
Re:.NET 10 by phito on Thursday November 13, 2025 @03:07AM (#45912120)
Still better than bringing JavaScript to the back end shudders
Re:.NET 10 by cies on Wednesday November 12, 2025 @04:36AM (#45898177)
Or GraphQL.

Still one lang on both ends is nice: there are some bits of code you want to run on both ends (like templating for SSR/SEO/caching; but also using them in the browser).

Re:.NET 10 by pjmlp on Wednesday November 12, 2025 @04:47AM (#45898236)
While suffering the performance loss of V8 versus CLR, JVM or any compiled language.

One of the reasons I am back to writing more C++ code is C++ addons for node.js, as several SaaS products now only care about Next.js as extension SDK.

Re:.NET 10 by petesergeant on Wednesday November 12, 2025 @05:09AM (#45898384)
> While suffering the performance loss of V8 versus CLR, JVM or any compiled language

The number of startups for whom that performance differential matters more than developer output is tiny.

Re:.NET 10 by pjmlp on Wednesday November 12, 2025 @05:42AM (#45898590)
Yeah, except plenty of them are probably using Kubernetes and NoSQL, because everyone dreams to be Google.
Re:.NET 10 by phillipcarter on Saturday November 15, 2025 @12:06PM (#45938839)
I don't think it's about dreaming to be Google. K8s is pretty easy to set up now with a hosted cloud platform if you start with it, and helm takes care of pretty much all your infra needs. Migrating to K8s is what's awful. From there, the docs have most everything you need to know and there's an abundance of helpful information online that covers most problems you'll run into.
Re:.NET 10 by DeathArrow on Wednesday November 12, 2025 @04:53AM (#45898276)
>You can easily use the same types and libraries in your backend and frontend with TypeScript. It’s not at easy with dotnet.

You can do that in .NET, too if you use Blazor for frontend.