Does Razor syntax provide a compelling advantage in UI markup?

Viewed 22111

I notice Scott Guthrie is starting to mention Razor a fair bit on his blog but I'm just not that sure that it's a good fit for my style.

Granted it's a fairly unfamiliar style for someone who's pretty used to a "standard" sort of ASP.Net markup (content place holders and inline code), but it just feels like a lot of additional pages to manage and less clear markup to me.

What are other peoples' feelings on it? Is it something that you believe should be seriously considered when scaffolding new MVC pages or is it just trying to solve a problem that doesn't exist?

2 Answers

Personally I really appreciate the reduction in how many escape characters are used. Using <% %> gets very tedious when compared to @{} and is not nearly as syntactically appealing.

Moreover, writing a whole definition for the codebehind and page is simplified to a single @model model.

As also noted by marcind, not having to always include runat=server is very nice also.

Overall, I really appreciate using the Razor engine and find it not only makes things easier on me to develop but also makes code easier to read.

Related