Saturday, September 17, 2011

Razor .... back to the Classic age

    A lot of developers who checked the Razor View Engine for the first time - including my self- had the following question up to their mined ... "hay! this is like classic ASP .... are we going back to spaghetti-code again?!!!".
    Will, comparing ASP.NET 1.0/2.0 with Classic ASP, I admire that there was some advantages for the later; with classic ASP you have a light wight tool with more control over the heavy set of .NET controls included in each ASP.NET page. also ....
"Classic ASP programming is the beautifull language in simplicity why? it is traditional and only has basic functionality, whenever you need a custom function/method you need to build it yourself. This make it different, this is usefull to exercise your programming logic. For example if you need to clear the HTML tags in PHP you simply apply the striptags method but in classic asp you need to build your own code with your own programming logic."
However, When Microsoft developed ASP.NET MVC ... one of it important parts was the View Engine Concept which is used inside the UI files. The ASP.NET team designed Razor as a new easy to learn,  simple syntax, and coded-template view-engine, beside its .NET based, Razor is much more easy than classic ASP, one good sample is the concept of reusable code (i.e. _Layout pages) that Razor provides

At last, its important to know that the Razor is not for ASP.NET MVC projects only ... you can build a ASP.NET website using Razor syntax project template


No comments: