Blazor: First Look and Impressions

The future of web development or a passing fad?

I keep hearing more and more about Web Assembly, and since I’m primarily a .NET developer, I figured it was time to play around with Blazor. I recently went through Microsoft’s Build your first Blazor app tutorial, and here are my initial thoughts and reflections on it.


The Good

First, it’s C# running in a web browser! And, unlike transpiled JavaScript languages, there’s no smoke and mirror’s here; it’s real C# running in a web browser! That’s super cool!

Second, it makes a lot of sense. In fact, if you’re familiar with React or Angular, you’ll feel right at home. Everything is a component and easily reused. The code and markup live together, which encourages small chunks of reusable components.

Third, as a .NET developer, I feel right at home. I’m using Razor syntax for writing the view, and C# for logic. Unlike modern JavaScript frameworks, there’s no mindset shift or shift in tooling when going from back-end to front-end development. I know multiple developers who love .NET and back-end development, but who don’t much care for front-end development because they hate JavaScript and the JavaScript ecosystem. Blazor closes that loop for them.

The Bad

For starters, this is only supported with .NET Core 3 preview and Visual Studio 2019 Preview. Originally I tried using Visual Studio Code, but I ran into some weird compilation issues (I gave up and switched to Visual Studio proper). This isn’t ready for production, and if I was building a web application starting today I would still pick a mature JavaScript framework such as Angular or React over Blazor. Microsoft is committed to supporting Blazor, and we can expect parts of Blazor to leave preview soon.

Second, the dual hosting model of Blazor is… different than what I’m used to. Having options is good, but I have to wonder, will one hosting model win out and the other be depreciated? What happens to your code base if you pick the losing hosting model? Not to mention, most front-end developers are used to thinking about their code running client-side. Switching to server-side is a change in mindset. But, once again, give Blazor time, I think these issues will work themselves out.

Third, browser tooling is lacking. When I ran into an issue with my code the first thing I did was open Chrome’s Developer Tools, go to the Sources tab… and my code wasn’t there. Of course, as WebAssembly is used more frequently, I’m confident browser vendors will continue to improve their tooling.

Finally, I’m not sure how well search engines can crawl a Blazor application. In fact, I can’t even navigate to a subpage of a Blazor application before it’s loaded. (For example, if my Blazor app was hosted on www.example.com, I can’t type in www.example.com/page and go directly there. I have to type in www.example.com and click the link on the home page to go to /page).

The Ugly

Blazor (and WebAssembly, for that matter) doesn’t support Internet Explorer. As of this writing, StatCounter reports that IE accounts for about 2.6% of all Internet traffic. But, depending on your customers, this may be substantially higher. For example, where I work, our website caters to business customers, and about 40% of our revenue comes from users on Internet Explorer 11. For us, choosing technology that doesn’t support IE11 isn’t an option.

Blazor also has a chicken or the egg problem. Today, if you’re primarily a front-end developer, you know JavaScript and JavaScript tooling. If that’s what you know and all front-end jobs are looking for JavaScript developers… how likely are you to learn C# and Blazor? (Or, for that matter, any technology that targets WebAssembly?) Plus, if you’re in charge of picking a technology to build your company’s next project in, will you pick something like Angular or React that is well known and has a huge talent pool available… or Blazor that doesn’t? Only time will tell Blazor reaches critical mass.


Summary

Blazor is super cool, it’s easy to pick-up, and even in preview, it works and it works well! Blazor and its ecosystem still need some time to mature, but clearly Microsoft believes in it. The only question is, will other developers?

Back to Blog Posts



You may also like:

NPM Considered Harmless

Package managers have their issues, but you can - and should - use them Read more...

Staying Cool When Firefighting Production Outages

Learn to stay cool when fixing production outages Read more...

Software Engineer vs. Computer Programmer

What is the difference between a software engineer and a computer programmer? Read more...