MVC as a Gateway to “Pure” HTML5

I still remember the launch date when .NET was announced to the world. I was working at Microsoft on the Visual Studio.NET team, and it was the day we could finally start talking about all the top secret .NET technology we had been developing. At the time, websites were very simple and web apps had just started emerging. Technologies like Javascript and CSS were fragmented and incompatible twinkles in our browser vendor’s eyes. Chrome and Safari had yet to be conceived. Since HTML was still a new paradigm for most developers, Microsoft created an object-oriented framework that sheltered most of the complexity around html with a simple drag and drop interface that lets you build apps visually. I fell immediately in love.

Pizza Over the Internet

I had previously created a pizza ordering system using classic ASP and COM. This was a killer app at the time. ASP classic really didn’t really support enterprise applications well. Having to do the “real” code in C++ and layer it with VBScript created a lot of hindering mismatch. It also made debugging very, very hard. The new hotness of ASP.NET laid the groundwork for a much brighter future. Along with ASP.NET, C# would be announced. It was a powerful new language by the guy who had invented Pascal and it gave the C++ developer a much more productive environment without the limitations of Visual Basic. The WebForms technology let you work with objects, events and controls in a way that sheltered you from the limitations and complexities of stateless HTTP, while providing a rich library for data-driven applications. The Pizza Apps of the future would rock so much that we would take them for granted.

All Good Things Come to an End

After a long and healthy relationship with ASP.NET as the primary platform for user experience development, I must admit, it’s time to move on. The world is now fast and fluid. HTML5 is finally feature-complete and the JavaScript engines can do things like run VMs and power world class games. There is even a new TV that runs entirely on HTML5.

With the new power, performance and richness of HTML5, it no longer makes sense to shelter the developer from it. Indeed, MVC provides a powerful framework for generating dynamic content and the new Razor view engine even makes integrating server side code with HTML a breeze. Its architecture allows an elegant separation of process into Models, Views and Controllers.

While MVC is a significant move toward a better .NET, it is not ideal for every company. MVC requires a fundamental understanding of object-oriented principles, which is not something most of today’s web designers possess. I’ve seen companies experience multi-year delays because they switched to MVC without considering the difficulty of finding qualified talent. Since MVC is so new, there are very few software developers that have sufficient experience with it and I see little indication this will change soon. Many MVC developers are literally learning on the job. If you have a good pool of MVC developers with a few projects under their belt, treat them well as they are not easy to find.

MVC as a Gateway to “Pure” HTML5

While I would not recommend creating a significant amount of functionality in MVC because of the difficulty of finding experienced developers, MVC is a great gateway to HTML5.  You can do the majority of user experience code in HTML5 and use server-side MVC for system-level code, like security authentication.

The User Experience Advantage

An entire generation of people is entering the world of computing having never owned a keyboard. I like to call them the “Cloud Generation.” This obviously includes early twenties hipsters, but also includes a surprising number of grandmothers, farmers, doctors and other people in non-desk professions. Ordering a touch device and plugging it into cloud services is the only computing model they know. With hundreds of thousands of apps to choose from and the ability to rate them poorly if they are hard to use or too buggy, users have expectations of their enterprise software that many in IT find unrealistic. Me too!  Enterprise software should be as easy to use as consumer home apps.

The user experience is now a competitive weapon. Developers who understand server-side development technologies and can also design competitive user experiences are few and far between. On the other hand, web designers who can make great looking and very usable websites are everywhere. Going with pure HTML5 means that you can give the user experience work to a web designer while the hard-core systems level security code can be handled by a different person. The result is user experience code written in super easy JavaScript that talks to industrial strength C# via JSON.

The Best of Both Worlds

Using ASP.NET MVC in a limited way to power a pure HTML5 user experience lets everyone focus on what they are good at, while keeping your team agile and responsive in a competitive environment. You are not “stuck” with the old UI because HR can’t find an MVC developer. Armies of recent college graduates already know how to take your app to the next level. Some of them don’t own keyboards so they know how your touch experience should work. Your app will work great on mobile devices and can be converted into a native app with a small amount of shell code. The technical name for this type of architecture is Model View ViewModel or MVVM. MVC: it is an excellent way to get there, if you remember that HTML5 is the king and MVC is there to play a supporting role.

One Comment

  • Lauren Hightower says:

    Well done, I couldn’t agree more with you. Relying on Razor and MVC as the ui engine at this point is really no different than relying on the forms model. The more independent we can make each of our concerns, the more usable and re-usable the app will be. And the more industry-standard (html5) instead of vendor-specific (Razor) we can get, the better off we’ll be when the next thing comes along.