The .NET Stacks #32: 😎 SSR is cool again

daveabrock

Dave Brock

Posted on January 18, 2021

The .NET Stacks #32: 😎 SSR is cool again

Good morning and happy Monday! We’ve got a few things to discuss this week:

  • The new/old hotness: HTML over the wire
  • Xamarin.Forms 5.0 released this week
  • Quick break: how to explaining C# string interpolation to the United States Senate
  • Last week in the .NET world

The new/old hotness: server-side rendering

Over the holidays, I was intrigued by the release of the Hotwire project, from the folks at Basecamp:

Hotwire is an alternative approach to building modern web applications without using much JavaScript by sending HTML instead of JSON over the wire. This makes for fast first-load pages, keeps template rendering on the server, and allows for a simpler, more productive development experience in any programming language, without sacrificing any of the speed or responsiveness associated with a traditional single-page application.

Between this and other tech such as Blazor Server, the “DOM over the wire” movement is in full force. It’s a testament to how bloated and complicated the front end has become.

Obviously, rendering partial HTML over the wire isn’t anything new at all—especially to us .NET developers—and it’s sure to bring responses like: “Oh, you mean what I’ve been doing the last 15 years?” As much as I enjoy the snark, it’s important to not write it off as the front-end community embracing what we’ve become comfortable with, as the technical details differ a bit—and we can learn from it. For example, it looks like instead of Hotwire working with DOM diffs over the wire, it streams partial updates over WebSocket while dividing complex pages into separate components, with an eye on performance. I wonder how Blazor Server would have been architected if this was released 2 years ago.

Xamarin.Forms 5.0 released this week

This week, the Xamarin team released the latest stable release of Xamarin.Forms, version 5.0, which will be supported through November 2022. There’s updates for App Themes, Brushes, and SwipeView, among other things. The team had a launch party. Also, David Ramel writes that this latest version drops support for Visual Studio 2017. Updates to Android and iOS are only delivered to 2019, and pivotal for getting the latest updates from Apple and Google.

2021 promises to be a big year for Xamarin, as they continue preparing to join .NET 6—as this November, Xamarin.Forms evolves into MAUI (the .NET Multi-Platform App UI). This means more than developing against iPhones and Android devices, of course. With .NET 6 this also includes native UIs for iOS, Android, and desktops. As David Ramel also writes, Linux will not be supported out of the gate and VS Code support will be quite limited.

As he also writes, in a community standup David Ortinau clarifies that MAUI is not a rewrite.

So my hope and expectation, depending on the complexity of your projects, is you can be up and going within days … It’s not rewrites – it’s not a rewrite – that’s probably the biggest message that I should probably say over and over and over again. You’re not rewriting your application.

Quick break: how to explain C# string interpolation to the United States Senate

Did I ever think C# string interpolation would make it to the United States Senate? No, I most certainly did not. But last month, that’s what happened as former Cybersecurity and Infrastructure Security Agency (CISA) head Chris Krebs explained a bug:

It’s on page 20 … it says ‘There is no permission to {0}’. … Something jumped out at me, having worked at Microsoft. … The election-management system is coded with the programming language called C#. There is no permission to {0}’ is placeholder for a parameter, so it may be that it’s just not good coding, but that certainly doesn’t mean that somebody tried to get in there a 0. They misinterpreted the language in what they saw in their forensic audit.

It appears that the election auditors were scared by something like this:

Console.WriteLine("There is no permission to {0}");
Enter fullscreen mode Exit fullscreen mode

To us, we know it’s just a log statement that verifies permission checks are working. It should have been coded using one of the following lines of code:

Console.WriteLine("There is no permission to {0}", permission);
Console.WriteLine($"There is no permission to {permission}");
Enter fullscreen mode Exit fullscreen mode

I’m available to explain string interpolation to my government for a low, low rate of $1000 an hour. All they had to do was ask.


🌎 Last week in the .NET world

🔥 The Top 4

📢 Announcements

📅 Community and events

🌎 Web development

🥅 The .NET platform

⛅ The cloud

📔 Languages

🔧 Tools

📱 Xamarin

🎤 Podcasts

🎥 Videos

💖 💪 🙅 🚩
daveabrock
Dave Brock

Posted on January 18, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related