Saturday, 13 February 2016

MVC vs Angular



I am a greate fan of MVC but i think Angular and WebAPI is going to kill MVC.

One up side about MVC would be every thing can be done in one language: C# but that's not the winning point because "MVC [Required]..." cause, jQuery Validation is very kludgy, not performant at all, hard to attach validators to newly added dom elements, etc.

I personally prefer pure HTML views, an entirely angular front end along with a Web API/EF/SQL Server back end, basically no Razor. Razor is an abstraction to help programmers render HTML, these days everyone's coming to the conclusion that removing these abstractions is a better idea, hence the evolution of ASP.NET from web forms, to MVC etc. It's not really difficult for developers to get to grips with HTML and use an angular front end, moreover this makes UI designers jobs easier, they have pure HTML and JSON/Javascript, they don't need to go about understanding MVC, Razor, controllers and actions. We used to work completely on MVC, in our latest project we moved to a Web API back end and an angular front end, and we've noticed that our UI designer's productivity has vastly improved.

Razor is a horrible thing even among templating engines. You'll notice a drastic increase in productivity when using angular over any templating engine (Jade, handlebar, razor etc). Use a backend which serves JSONs (can be web-api, node-express or PHP) and a angular front end is a perfect match.

I think my next project would be in WebAPI + Angular will play well. Because API first with angular, iOS, Andriod all talking is the nice way to go. Everything is WebAPI now.

No comments:

Post a Comment