• 0 Posts
  • 23 Comments
Joined 1 year ago
cake
Cake day: June 20th, 2023

help-circle






  • Razor

    Razor is the templating engine that’s been there since the original MVC. Blazor Server is the one that needs a server and streams changes to the client using signalR. Blazor WASM is the one that uses Web Assembly. As of .Net 8, Blazor can now also ne used as a generic SSR backend. They all use Razor Components, which is a component model using the Razor engine.

    Not to be confused with Razor Pages, which is also a generic SSR backend.






  • I didn’t have an answer for a very long time. Or more seriously, the answer was “the one that paid the most”. I’ve run the gamut of popular languages, C, C++, Java, Javascript, perl, ruby, Python, Visual Basic, VB.Net, C# and F#.

    But the last couple years it’s really been C#. The pace of development on the language/runtime has really picked up with yearly releases. The features that are added and iterated on are expressive and intuitive. You can tell from the discussion posts on how a feature is being considered for inclusion is thoughtful and deliberate. It really feels like the language is in good hands.

    Just wish those hands weren’t Microsoft.



  • I find ORMs exist best in a mid-sized project, most valuable in a CQRS context.

    For anything small, they massively over complicate the architecture. For the large enterprise systems, they always seem to choke on an already large and complex domain.

    So a mid size project, maybe with less than a hundred or so data objects works best with an ORM. In that way, they’ve also been most productive mainly for the CUD of the CRUD approach. I’d rather write my domain logic with the speed and safety of an ORM during writes, but leverage the flexibility and expressiveness of SQL when I’m crafting efficient read queries.



  • I like Blazor and use it exclusively at my work (usually to build the same type of stuff I’d use a HARP approach in a personal prj).

    Blazor is awesome, but really is attractive to backend .Net developers more than anyone else. However, Blazor has a bunch of downsides: Blazor Server is too chatty to build scalable public facing webapps. Blazor WASM has a massive initial payload, which makes it slow and heavy.

    Also, it just really falls into being overkill for so much stuff on the web. Half the shit I’m paid to build with Blazor would be faster and cheaper with just some htmx. Most SPAs are attempting to build a sand castle with an excavator.


  • I’d use what I’ve been experimenting with exclusively on personal projects: htmx, AlpineJs and Razor Pages on PostgreSQL AKA the HARP stack. Obviously, a hilarious acronym was needed.

    Which might sound esoteric and hipster, but I’d contend it’s pretty close to how we were building websites for decades before the cult of the SPA took over. For those not in the know, HARP is built with no fe frameworks, everything is rendered server side and html is swapped in the DOM on the fly. Htmx is a very tiny js library that makes backend requests to the server, and renders the returned htmx within the current page. AlpineJs is a client-side js library that acts like a modernized and simplified jQuery. Razor Pages is part of the ASP.NET web framework that runs on .Net, and produces html from Razor templates coded with C#. My professional work is on SQL Server, but I like PostgreSQL as the runner up because I’m not paying mssql out of my own pocket.

    I’m wouldn’t be concerned with hiring since I’d mostly just need C# developers with some designers. .Net developers are a dime a dozen, and many are seasoned vets with 15+ years experience building with .Net. It’s easy to build a career with just C#/.net/asp.net so few of these devs are running around flipping frameworks every few hype cycles.

    But I might have just shown my age and bias.




  • Plus, with server side rendering you also have to recompute the HTML for the entire site, which often means re-computing a whole bunch of non-trivial queries as well.

    This is actually why I really like HTMX, you load a page once, then make AJAX requests that return html which you can use to replace or add to the DOM. It provides an interactive front end where the backend provides full rendered html partials. Simplifies the entire application by keeping logic and state only on the server, which means you never have to worry about synchronizing front-end and backed state.