Live data from Hacker News

.NET Blazor

dusted.codes

191–200 of 302 posts

Re: .NET Blazor

#191
post #35
post #2

A lot of people seem to think that front-end and back-end developers are intrinsically different people. This would be the reason why full-stack frameworks (Kotlin for JavaScript, Scala.js, JavaScript backends, and now Blazor) never really take off. I find this rather strange. I can understand that people specialize, but it's not like typical application front-end or back-ends are rocket science and require a PhD or…

Because I can learn javascript, and work at myriad companies using any backend language. Or I can learn Blazor and work at the half dozen firms deploying it to production (maybe there are more in Europe).

It's not about learning Blazor per say.

It's about learning C# .NET and working at the many, many companies who use .NET in some capacity for their various needs like desktop apps, data processing services, etc, and of course web with Blazor. I can take my existing skillset in C# .NET and apply it to many different things.

I find no lack of companies hiring C# .NET devs in the midwest.

Re: .NET Blazor

#192

All the dis-advantages are not relevant for enterprise LOB apps, which Blazor is best suited for. Millions of .NET developers across the enterprise world are heaving a sigh of relief to never have to touch JS and be cozy and comfortable in their .NET ecosystem. With the latest addition of fully SSR, Blazor is also well suited for CMS, Blogs, Content Mills, small web apps, portfolio sites, etc. But, as a developer who…

I feel like your comment touched a million different places so I'll try to compose my arguments in a compact manner, hopefully to make some sense. > All the dis-advantages are not relevant for enterprise LOB apps, which Blazor is best suited for. Where does this conclusion come from? At least from my humble experience,I've been doing them for ~10 years with various tools, both JS and Blazor/Razor Pages and the fact t…

I spend most of my dev time in typed languages. Going to untyped languages feels like going from K'nex to clay.

Re: .NET Blazor

#193
This article is really odd. The long lists of disadvantages feel a lot like the lists of disadvantages that ChatGPT produce, where relevant disadvantages will be placed right next to things that are wildly inapplicable to whatever I'm doing. And the whole list is extremely impersonal - there isn't a single reference to the product(s) that the author worked on, so it's impossible to tell if the downsides are even real downsides or not.

Re: .NET Blazor

#194

Earlier quoted context omitted.

The problem is, all of this stuff will probably be dead in a few years. I think they would be better off working within established paradigms rather than trying to do something completely new. How about, for example, making it as easy as possible to use React with a C# backend?

Contrary to Google, MS never kills any tech. You can still develop Winforms apps today.

Blazor is just a new iteration on Volta (2007) https://en.m.wikipedia.org/wiki/Microsoft_Live_Labs_Volta

Re: .NET Blazor

#195

All the dis-advantages are not relevant for enterprise LOB apps, which Blazor is best suited for. Millions of .NET developers across the enterprise world are heaving a sigh of relief to never have to touch JS and be cozy and comfortable in their .NET ecosystem. With the latest addition of fully SSR, Blazor is also well suited for CMS, Blogs, Content Mills, small web apps, portfolio sites, etc. But, as a developer who…

For me, just the fact that I don't have to deal with JS bullshit and ecosystem including node/npm hellhole is a win for me. Before these shiny JS frameworks came along, .NET already had great UI component libraries as well including syncfusion (my favorite) and many others. I only do VueJS when I do use JS but man I can't wait to not write any code in JS.

Yea, I've been using Blazor in .NET 8 through the previews and it's really nice.

The Server Side Rendering is fast like any server-rendered stuff. Enhanced Navigation means that pages load even faster since they're just using `fetch` to get the next page and swapping the content (like Turbo in Rails). When I need some interactivity, the page still renders from the server and then the browser downloads the WASM in the background.

With .NET 8, Blazor is really ready. It isn't perfect, but it's so productive for me and the downsides are really minimal. Plus, it'll likely get a lot better with .NET 9 in a year because of WASM-GC (and post-MVP improvements to WASM-GC). With WASM-GC, .NET won't need to ship a garbage collector and WASM-based stuff won't need to copy between WASM and JS for DOM manipulations.

Since people might want the "minimal" downsides, I'll put them here. If you're using Blazor SSR with WASM, after the first interactive page renders for the first time, there's a second or two before the interactivity is actually available while it downloads the WASM (on interactive components, not links or anything). If you were making a Facebook clone, it'd mean that the "like" button on posts wouldn't work for a second or two. This is pretty minimal for two reasons. First, it's just the first page load of the first interactive page. After that, the WASM is cached in the browser. Second, most of the time people need a few seconds to read the content before using an interactive bit. All of the navigation and such works instantly, but an interactive bit like a "like" button takes a second or two.

If you want to get rid of that, you can use interactive-auto. This means that the first interactive page load will use a web socket and the interactive bits will be done with Blazor Server. It'll download the WASM in the background and switch to WASM for future page loads so you don't need the web socket for the vast majority of your stuff. However, web sockets do create a certain amount of hassle since you need to make sure that any proxies in-between handle web sockets and that you consistently route the user to the correct backend if you're load balancing.

To me, those downsides are minimal and don't have a lot of user impact for me. This is in contrast with Blazor in .NET 7 where I'd have to choose using a web socket all the time or having a big WASM payload that meant the page didn't render for a few seconds and gave users a crappy experience.

If you're primarily creating something that would be server-rendered (like Rails or Django), Blazor offers that with the additional nicety that you can add interactive elements without needing to deal with JS. That isn't meant as a "JS is crappy" comment, but to note that having to deal with another ecosystem where you need to duplicate your models and keep them in sync, having to deal with another build system or glue things together yourself, etc. is a pain when it isn't your main focus. So many sites end up with a full front-end stack and all the hassle involved because they need a couple pages or want to keep a consistent component system. Blazor means that you don't have to go that route.

Re: .NET Blazor

#196

All the dis-advantages are not relevant for enterprise LOB apps, which Blazor is best suited for. Millions of .NET developers across the enterprise world are heaving a sigh of relief to never have to touch JS and be cozy and comfortable in their .NET ecosystem. With the latest addition of fully SSR, Blazor is also well suited for CMS, Blogs, Content Mills, small web apps, portfolio sites, etc. But, as a developer who…

I use swashbuckle and swagger-typescript-api to automatically scrape my controllers and generate API calls and TS types every time I rebuild. No hassle or overhead at all. No need for converters or anything. I've been using this now for several projects, it's a great way to have all the power of TS for client side and C# for server side. https://www.npmjs.com/package/swagger-typescript-api https://www.nuget.org/packa…

I do the same in Django with drf-spectacular. I have a precommit hook that autogenerates (fairly thin) TypeScript schemas and routes on commit. This is not take merit from LOB devs who want to use C# back-to-front. I will use it as an argument to those who say that this is why you should go full TypeScript on any new web project though.

Re: .NET Blazor

#197
post #145

Earlier quoted context omitted.

The problem is, all of this stuff will probably be dead in a few years. I think they would be better off working within established paradigms rather than trying to do something completely new. How about, for example, making it as easy as possible to use React with a C# backend?

React will die too, eventually. Or at least stop becoming the default.

Let's say it does: It leaves behind a WebAPI backend that [new hotness] can utilize. WebAPI is an agnostic protocol.

What does Blazor leave behind? Nothing reusable at all. It is a proprietary server hosting proprietary connections via proprietary pipeline. Plus sometimes inscrutable WebAssembly. Just go ask all the companies STILL stuck on Web Forms or Silverlight how that worked out for them the last times? Exactly.

Friends don't let friends buy into proprietary backends that muddy the water between UI/API layers. Stick to WebAPI and put whatever you want in front. That way you can migrate either front OR back independently of one another (and or do piecemeal migrations).

PS - This has nothing to do with "Microsoft bad." This has to do with standard protocols between front/back Vs bespoke stuff. I'd also criticize the short-sightedness if another company offered the same thing.

Re: .NET Blazor

#198

All the dis-advantages are not relevant for enterprise LOB apps, which Blazor is best suited for. Millions of .NET developers across the enterprise world are heaving a sigh of relief to never have to touch JS and be cozy and comfortable in their .NET ecosystem. With the latest addition of fully SSR, Blazor is also well suited for CMS, Blogs, Content Mills, small web apps, portfolio sites, etc. But, as a developer who…

I feel like your comment touched a million different places so I'll try to compose my arguments in a compact manner, hopefully to make some sense. > All the dis-advantages are not relevant for enterprise LOB apps, which Blazor is best suited for. Where does this conclusion come from? At least from my humble experience,I've been doing them for ~10 years with various tools, both JS and Blazor/Razor Pages and the fact t…

.NET 8 comes with Blazor United (renamed to simply Blazor) that combines the Blazor Server and Blazor WebAssembly frameworks.

For client side components C# code is compiled into WebAssembly that manipulates the DOM just like JS.

Today with Blazor Server, the main drawback is the slight delay you can get when you click something. .NET8 essentially blends Server and WebAssembly and solves the problem, even giving you the best of both worlds since WebAssembly has high first load times, .NET8 Blazor loads initially with Server side and provides client side after it loads all resources.

Re: .NET Blazor

#199
post #174

Earlier quoted context omitted.

That's my issue as well; over the years I've developed some insight in visual design and UX, but it's not my strong point and I don't want to be responsible for design. Luckily, I've always worked with designers and people who are better at CSS. My point is, I've done front-end for most of my career without having to do design work.

> over the years I've developed some insight in visual design and UX … Luckily, I've always worked with designers and people who are better at CSS These two things are completely tangential. Translating a design into well structured HTML/CSS should not require any UX or design experience. In the same way, you don’t need to know HTML/CSS to create a good design and UX.

I think sometimes there's often gaps where you have to fill in for the designer.

Re: .NET Blazor

#200
post #164

Earlier quoted context omitted.

.NET 8 is suppose to greatly improve AOT. Depending on your use case, you might be able to get around bundling the runtime entirely.

As far as I understand, .NET 8 AOT has nothing to do with the webassembly blob that gets served to the client.

They’re working on it. .NET 8 introduces the option to perform a degree of trimming on the AOT output. https://learn.microsoft.com/en-us/aspnet/core/blazor/host-an...
Post reply on HN