DEV Community

Cover image for Choose the life of Blazor  and WebAssembly
Manish Sinha
Manish Sinha

Posted on

Choose the life of Blazor and WebAssembly

The early humble beginning

I started my programming career creating websites using HTML, CSS, and plain JavaScript in 1999-2000. It was very early on I realize that JavaScript with all its power comes with weird quirks which made my life miserable.

The disillusion

Then I discovered PHP, MySQL, and the entire LAMP stack which moved me to start writing web backend code. Well, PHP was even worse than JavaScript and after a few years of dabbling around with Django, Flask, etc, I quickly gave up on web development for good.

Enter WebAssembly, the new natively supported runtime for the web. JavaScript for all its popularity is still a rage-inducing language if you have been used to sane languages or even half-sane ones.

Blazor a new offering, which is closely tied to ASP.NET Core and the .NET Core ecosystem is based upon WebAssembly seeks to bring C# to the client-side. One might be horrified at the thought of C# on the client-side, but ask yourself

"Is it worse than the entire existence of JavaScript in the first place?"

The good times

With my limited experience of Blazor, I am indeed enjoying this new technology stack. I have written absolutely zero JavaScript and created some really interactive and fun-filled web app with extreme amounts of code sharing between client and server. Thanks to the Visual Studio ecosystem, it was one-click deployment on Azure and in-built authentication to Active Directory or any other login systems.

But but ASP.NET Core?

How is Blazor different than ASP.NET Core? In the case of ASP.NET Core, you still have to write JavaScript intermixed with Razor template code, whereas in Blazor all your HTML elements are bound to C# objects and you do manipulations using C# which get reflected in the DOM. Using Blazor you don't directly modify the DOM, but you use data and event binding to control the behavior of the elements.

Try out Blazor yourself and you will be pleasantly surprised. It's a bit rough given that is a brand new technology, but I am very confident that it will improvise dramatically over time.

I am going to share more posts with my experiences in the coming weeks.

Top comments (0)