Most active commenters
  • hakanderyal(6)
  • WorldMaker(4)

←back to thread

201 points olvy0 | 30 comments | | HN request time: 1.152s | source | bottom
1. blackoil ◴[] No.41878798[source]
Anyone knows of a comprehensive book/tutorial to learn end to end web development in dotnet. Most I have found are elementary, outdated or poor quality.
replies(5): >>41878995 #>>41879009 #>>41879030 #>>41879834 #>>41879860 #
2. DeathArrow ◴[] No.41878995[source]
I've learned by doing, but here you go.

Books: C# 12 and .NET 8 - Modern Cross-Platform Development Fundamentals - Eighth Edition: Start building websites and services with ASP.NET Core 8, Blazor, and EF Core 8 by Mark J Price

Web API Development with ASP.NET Core 8: Learn techniques, patterns, and tools for building high-performance, robust, and scalable web APIs by Xiaodi Yan

Turorials: series of tutorials on YouTube by IAmTimCorey and Shawn Wildermuth.

3. littlecranky67 ◴[] No.41879009[source]
That is because all the hot-and-new in .NET web development is Blazor, and it is not really popular outside of Microsoft's Blogosphere (and IMHO never will be and go down the same way as Silverlight did). The "venerable" technologies are still present in .NET 9 and still work, get maintained etc.

Doing web dev in .NET nowadays for me is mostly creating HTTP/JSON/REST APIs and using whatever FE framework you like to interface it (for me that is React or NextJS). The keyword you want to search for is "ASP.NET WebApi" or - more modern - "ASP.NET minimal API".

You could still do .NET MVC server-side rendering using "Razor" (the markup language in ASP.NET MVC - search for "ASP.NET MVC Razor".

replies(4): >>41879547 #>>41882023 #>>41882374 #>>41883629 #
4. emmanueloga_ ◴[] No.41879030[source]
I've recently taken an interest in web development using C#. It seems to me that ASP.NET is THE way for creating web applications in .NET, for better or worse ("for worse" since lack of alternatives sounds a bit suspicious to me...).

Anyway, I came across a podcast featuring the author of "ASP.NET Core in Action", Andrew Lock, and he seems to know his stuff. I haven't read the book yet, but maybe this is the book you are looking for.

--

1: https://dotnetcore.show/season-6/navigating-the-aspnet-core-...

2: https://www.manning.com/books/asp-net-core-in-action-third-e...

replies(1): >>41879625 #
5. WorldMaker ◴[] No.41879547[source]
Blazor for better and worse can't have the same ending as Silverlight did. In Server Mode it is just Razor + SignalR for HTMX-style frontends that sort of live update/"magic RPC". In Client Mode it is just Razor as a virtual DOM-ish framework running directly in Web Assembly (wasm) in the Browser. At the end of the day Client Blazor is much more like writing front end websites with Elm than writing websites for the Silverlight plugin.

(Hybrid Blazor where you use both server and client possibly in the exact same assembly/project is where most of the worst Blazor mistakes lie, but those aren't the mistakes of Silverlight, those are the mistakes of ASP Classic before .NET where you can be easily confused by new versions of the which bit of this is `runat="server"` and which bit is `runat="client"` and easily and accidentally create wild RPC ravioli/spaghetti code.)

replies(1): >>41879816 #
6. WorldMaker ◴[] No.41879625[source]
There are alternatives, but most of them have been "consumed" in that ASP.NET does what they do better (most recently "ASP.NET Minimal API" removed a lot of the appeal for many of the smaller alternatives), or "consumed" because "ASP.NET" the brand also includes the low level HTTP machinery at this point and alternatives are increasingly "ASP.NET + some extra framework" which doesn't sound like an alternative, or are focused on small niches and other languages. There's a lot of fun alternatives in F# (Giraffe is the first one to my mind), but obviously that is no longer web development in C#.
replies(2): >>41879781 #>>41879814 #
7. DonnyV ◴[] No.41879781{3}[source]
Modern Asp.net stole a lot from a little web framework called NancyFx. It really shaped what Asp.net Core is today.
replies(1): >>41880733 #
8. nickpeterson ◴[] No.41879814{3}[source]
I really wish suave wasn’t abandoned. We could have such nice things in F#-land but all of our the cool stuff gets dropped in favor of veneers over ms frameworks.
replies(1): >>41883914 #
9. hakanderyal ◴[] No.41879816{3}[source]
Do you know of any performant, quality examples of Blazor out in the wild? All the examples I've seen have unacceptable UX by modern standards.
replies(3): >>41880226 #>>41880506 #>>41880871 #
10. hakanderyal ◴[] No.41879834[source]
For server-rendered UI, look for resources that uses Razor, ignore Blazor stuff at the beginning.

For .NET Backend/JS Frontend, look for resources that uses minimal APIs. MVC is also good but has a lot of backwards compatibility baggage that led to the creation of minimal APIs.

11. greener_grass ◴[] No.41879860[source]
A bit of the beaten path, but F# with Fable is a very powerful combination.

On the server you can run ASP.Net using Giraffe, which is a Functional Programming layer with comparable performance to C#.

On the front-end, you can write React in an true Functional Programming language.

And of course you can share F# code between frontend and backend.

replies(1): >>41880511 #
12. m_fayer ◴[] No.41880226{4}[source]
https://github.com/Webreaper/Damselfly
13. parineum ◴[] No.41880506{4}[source]
> All the examples I've seen have unacceptable UX by modern standards.

What does that have to do with Blazor?

One could easily write outdated UX in React if they so choose.

replies(1): >>41880577 #
14. williamcotton ◴[] No.41880511[source]
An architecture I've been using lately is writing a functional core in F# and importing the library in both C# API backends as well as React frontends. As you know, Fable can compile to TS which you can import into your node application.

This means that you can have a team of C# developers writing in a language they are familiar with, a team of node/TS developers writing React and a team of F# developers working on a pure functional core with all of the business logic. Write your validators in F# can you can share the same logic for a form in the UI and an API endpoint on the backend.

In my opinion having type inference, discriminated unions, computation expressions, et al., makes for a very concise and expressive way to model the core logic of an application.

15. hakanderyal ◴[] No.41880577{5}[source]
It's the slowness/sluggishness, not the looks. Most of the time even a simple interaction like clicking a checkbox takes ~1-2 seconds, which probably comes from tracking the state on server.

(I don't mind outdated for .NET stuff, nearly everything from enterprise vendors looks like it just jumped out of WinXP anyway.)

replies(2): >>41880907 #>>41883643 #
16. WorldMaker ◴[] No.41880733{4}[source]
I agree, "Minimal API" owes a lot to Nancy, specifically. There were a few others in that space, but Nancy was definitely the big one that pushed ASP.NET the most.
17. WorldMaker ◴[] No.41880871{4}[source]
Certainly I also can't imagine how you would get strong performance out of Server Blazor in real world/Enterprise conditions. RPC busses are going to RPC and roundtrips are still roundtrips even when SignalR-backed web sockets. Flooding UDP web sockets with HTML chunks isn't necessarily a great idea, even if HTTP3 (QUIC) kind of/mostly succeeds at it, but SignalR as good as it is certainly isn't HTTP3.

On the other hand, Client Blazor has huge initial overhead (it compiles a form of the entire .NET platform in WASM; you can golf it down a bit, but it's still an entire runtime and GC and most of a standard lib depending on what your app does, and its dependencies), but once it is loaded it can be as performant as just about any other Virtual DOM-like (modulo the overhead between DOM/JS and WASM, but that overhead is surprisingly small in current browsers and seems to only get smaller as browsers continue to optimize WASM scenarios).

I don't think I'd recommend it for most consumer-facing websites any time soon, but in my experience Client Blazor is still much better than Angular for performance in an Enterprise/Internal App scenario.

replies(2): >>41882841 #>>41888399 #
18. parineum ◴[] No.41880907{6}[source]
I've never seen that behavior, even in the preview/beta versions. That example is less complicated than the sample project that you get when you create a brand new project from the visual studio template (it's something like increment a counter on the server side via button clicks iirc).

There were definitely some quirks and issues early on but they've done a pretty good job at smoothing that stuff out since it's gone through two LTS version of .NET.

The pipeline for something like that is click->js/wasm websocket->server code->websocket->ui updates. If you're doing something absurd on the back end when a checkbox is clicked, sure 1-2 seconds but that's a developer problem, not a Blazor problem. If you put me in front of a React app, I'd probably do something stupid like that too because I don't have much experience with it.

I suspect your complaint is more related to .NET/Blazor making it easier for less experienced developers to develop a working site/page with a lot of spaghetti where that same developer would struggle to create the same page in another ecosystem. If you compare to equally senior/experienced developers in different frameworks, I suspect you'd see the same basic performance from the two platforms up until a scale that very few of us are actually working in. Blazor can be quite fast if you don't write bad code.

I find a lot of the complaints about .NET to be that it enables developers who write bad code to get things done inefficiently instead of not being productive at all. IMO, having senior developers doing code reviews is pretty essential if you have junior developers on a team but the ability to build something, even if poor, can really accelerate the learning process when a senior person can look at a complete project, point out the issues and show the difference that the corrections make.

Sorry for the rant and sorry if this doesn't really apply to you specifically.

replies(1): >>41881105 #
19. hakanderyal ◴[] No.41881105{7}[source]
I get where you are coming from, and I'm on the same page. I'm not complaining about Blazor, I'm complaining about not finding any good examples. That's why I'm asking around.

I'm looking for something that will make me "wow, Blazor can be used to build great apps!" or "ok has advantages over the React/Vue etc. equivalent".

Because if there aren't any, in similar thinking with parent, I'm afraid that it won't catch up and it'll go the way of silverlight, so I refuse to invest any time.

replies(1): >>41881704 #
20. CrimsonCape ◴[] No.41881704{8}[source]
The best Blazor app i've seen is nodexr.

https://www.nodexr.net/

https://github.com/Jcparkyn/nodexr

replies(1): >>41883563 #
21. MangoCoffee ◴[] No.41882023[source]
>IMHO never will be and go down the same way as Silverlight did

There is a difference: Silverlight was not open-source, whereas Blazor is open-source on both server-side and WebAssembly (WASM).

ASP.net MVC has reached maturity and is notably used in project like NopCommerce.

22. tracker1 ◴[] No.41882374[source]
Also worth looking into are some of the extensions for Razor/HTMX views, which IMO is a way better approach than server-managed Blazor. Jetbrains has a few good videos and really nice dev extensions for this approach.

I also think wasm Blazor is a non-starter as well until WASM GC integration in the browsers gets fully integrated for C# targets.

https://www.youtube.com/watch?v=uS6m37jhdqM

23. hakanderyal ◴[] No.41882841{5}[source]
Thanks, that confirms my initial findings.

I’ll look for an opportunity to give client Blazor a try.

24. hakanderyal ◴[] No.41883563{9}[source]
That's what I was looking for, thanks!
25. Alupis ◴[] No.41883629[source]
Why is this still a problem within the dotnet world? Why aren't there a dozen popular application frameworks to choose from like there is for Java and most other languages?

In dotnet, it seems everyone uses the Microsoft "blessed" framework, until Microsoft does a full rewrite or loses interest - then everyone has to rewrite their stuff too.

There's no way Microsoft are the only ones capable of producing good library/framework ideas - so what gives?

replies(2): >>41884607 #>>41884768 #
26. aksss ◴[] No.41883643{6}[source]
> 1-2 seconds

Something is wrong there, probably someone is screwing up form validation in their component framework or something, but IME that’s not a Blazor thing.

27. fire_lake ◴[] No.41883914{4}[source]
Suave isn’t dead - it’s more “complete”

What is missing? I might make a PR :)

28. ozim ◴[] No.41884607{3}[source]
Because most of .net use is enterprise so people using it go with “no one ever got fired for buying IBM” way of doing things.

If project goes belly up no one can pin it on you choosing something non standard.

So it is a feature of dotnet ecosystem not a bug “doing stuff the MSFT way”

29. neonsunset ◴[] No.41884768{3}[source]
Do you really need that many choices? I always thought that proliferation of back-end implementations in Python, routers in Go and large alternatives in Java was mostly a sign that traditional "default" choices in the ecosystem are subpar.

ASP.NET Core is strong and overall better option when compared to FastAPI, RoR, Spring or Node.js with Express/Nest.js. EF Core with LINQ and safe SQL interpolation is one of if not the best ORMs that exist on the market across all programming languages.

This results in much weaker demand for alternatives, and combined with community that historically erred on the side of "out of box" choices, it's no surprise that there aren't really big viable alternatives to ASP.NET Core. There are for EF Core though - Dapper/DapperAOT and Linq2Db. Aside from that, most community libraries, both C# and F#, instead usually opt to build on top of them, like Fast-Endpoints or Giraffe/Oxpecker.

.NET could use a framework that is what Vert.X is to Spring, but even existing landscape is so much better than almost every other alternative, that it's difficult to complain, except, I suppose, when it comes to Identity and Authn/Authz in general that are more complex than ideal.

p.s.: I'm not saying that all "first-party" libraries are good. ASP.NET Core and EF Core, especially their "core" functionality are great. The surrounding selection of packages however can be hit or miss, and it's where a productive choice is to look for community libraries instead. It's an area that is slowly getting better.

30. CyanLite2 ◴[] No.41888399{5}[source]
Blazor Server in an enterprise (intranet) is extremely fast because the network is extremely fast.

Across the Internet, it's still quite fast if you use Azure SignalR service, which is effectively a globally distributed CDN. Most commercial apps use this service.

Blazor WASM is better than I thought it would be. My company has built a healthcare SaaS app that has ~5k daily users on it and no one has complained about the initial rendering and download time to pull down 25MB on the initial load. This sounds like a lot but with modern broadband, 5G, and CDNs, this takes about a second or two.