Introduction
There was a time when programmers would work with bits and assembly language and you must agree that it was quite difficult to convert those bits and assembly in working pieces of software or programs. But it was all in the mid 19th Century. Today I don’t think any programmer software developer must work on it and they need not to.
A glimpse of Programming Languages Evolution
Bits => Assembly => High Level Languages => Object Oriented Programming => And Now Frameworks.
In this article, I will focus on ASP.NET MVC. I have worked with ASP.NET earlier and I would recommend it for RAD (Rapid Application Development) and if you are new to Web Development. I will highly recommend ASP.NET MVC for major Web Project Development.
It provides a great feature called separation of concerns; which means you need not to stick with its default behavior and architecture. In MVC views play an important role because views are all about how to represent your data to the end user and it’s also responsible for communicating with a controller and a model. By default MVC provides a great developer-friendly view engine called Razor. But this article is for those who don’t like to work with Razor or who want to work with Razor.
Spark View Engine
The Spark View Engine is another view engine for ASP.NET MVC, I would personally suggest that you don’t use any other view engine unless and until you really need to.
Now the question comes to our mind, "Why Spark view engine?".
If you search on the web you will find many discussions like Spark has gone or Spark is dead.
Actually it always depends on you how you grab new or different things and what encourages you to do so.
The important part of Spark is the integration of the HTML and code is very clean and easy to read. If you love HTML scripting then you will love its syntax because it’s quite similar to HTML that will keep your view clean.
Let’s compare it to ASP.NET Razor, WebForms and JSP.
The following is the ASP.NET Web form or JSP (both are quite similar) syntax :
- <ul>
- <% foreach(var p in ViewData.Model.Products) { %>
- <li><%= p.Name %></li>
- <% } %>
- </ul>
Razor Syntax
- <ul>
- @foreach(var p in Model.Products) {
- <li>@p.Name</li>
- }
- </ul>
And the beautiful Spark syntax is here:
- <ul>
- <li each=”var p in Model.Products”>${p.Name} </li>
- </ul>




Comments
Join the conversation! Your thoughts help the community grow.