views:

689

answers:

2

I was thinking about switching one of my projects (and after that subsequently other projects too) to Spark View Engine but after todays research I ran into problem of a lack of Intellisense for Visual studio 2010. Not only that but it seems that the project is not maintained regularly.

So I'm left with a feeling that I should not choose Spark at this time yet. However, apparently NHaml has the same "issues" too.

I know it is discussed in more detail here http://stackoverflow.com/questions/1451319/asp-net-mvc-view-engine-comparison

but I would still like you thoughts on what to choose or just stay with WebForms view engine for now?

A: 

I would recommend you staying with the WebForms view engine unless you have some serious reasons against it. Lack of Intellisense and Microsoft support come to mind. Also third party view engines might not follow with evolutions and updates that are brought to the WebForms view engine.

Also I have to disagree with people saying that WebForms views look ugly. They look ugly not because of the nature of the view engine itself but because of people lacking knowledge of properly using it. For example developers tend to put lots of C# code inside views instead of using helpers which of course leads to spaghetti code (during code review sessions I've even seen programmers writing SQL queries into an ASP.NET MVC WebForms View, so what can I say more).

Darin Dimitrov
...or because of the engine itself. And by that i mean all the unnecessary <% %> scattered all around it just to print simple stuff or. The fact that you have the `each` attribute for looping also simplifies stuff a lot. Of course you would like to use helpers, but you still have to surround them with <%= %>. However, I agree that staying with the default one might be a smart choice here.
Arve Systad
You're ignoring performance in your argument. Spark views don't have to go through the same control cycle WebForms uses... this saves a lot of time. If you precompile your spark views, you'll beat webforms every single time. Also, the argument about Intellisense will be short-lived. There is already an Intellisense provider for 2008 and the 2010 is coming soon: http://bit.ly/bb2kx0
zowens
Even without intellisense, I've chosen to go with spark. And it is still SO much better than webforms. I save on average 15-20 lines per view. I don't think it's a lack of skill by developers that makes webforms code unmanageable. It's that the editor doesn't know how to format inline code. Loops and other multiline statements become unmanageable. I think a loop is pretty common in a view. Even without the intellisense, I think I save time. I've also been able to use the spark view engine for other parts of the site like email templates.
Matt Dotson
I have to disagree with you that loops are common. I use Editor and Display Templates that automatically loop if the property is a collection. For everything that is tables no loops are necessary either as there are helpers such as MVCContrib Grid.
Darin Dimitrov
+13  A: 

I love Sparks, compared to the WebForms view engine. All views get so incredibly clean, compared to the normal one. Intellisense or not, I'd still take Sparks. Easy choice. You still get runtime errors when something is missing, and when you get used to not having Intellisense there, it's not that much of a problem. Debugging might take those five extra seconds, but hey - readability and clean views before marginally quicker debugging of (mostly) simple syntax-issues.

I've used Spark for a project through four months now, and I'll never go back to the default one. Never had any serious problems with it once you get the hang of it, and it's absolutely worth it. You'll know when you see it in action for real :-)

Arve Systad
I know all the advantages and yes, views would really look much cleaner but I think productivity would fall considerably and what's the most problematic is that I need to choose a techonology which has wide support and defined development path even over a longer period of time - we cannot start a project now to found out 6 months later that we took the wrong path. Hopefully you understand my concerns and, sadly, it seems that none of the third party view engines are up to this as of now.
mare
I see. Then, the default one might be the best one for you. However, Spark does support everything that's currently in ASP.NET MVC, so unless you will be updating the basic platform too, Spark should manage. And for the support part, I think the documentation (which is actively being updated AFAIK) plus forums like this should suffice. However, it boils down to the feeling you have about it all. If you feel insecure about Spark, then use the default one.
Arve Systad
@Arve Systad: That's not entirely true, Spark's idea of *Areas* is different from MVC 2's idea of *Areas*.
R0MANARMY
@R0MANARMY How are they different? I've only slightly used Areas until now, and only with Sparks - and it seems to be exactly what i want from it anyways.
Arve Systad
@Arve Systad: Just the location of the view. Spark expects views for the areas to be under the main View folder (at least as of 1.1). MVC2 expects views to be in the appropriate folder under Areas.
R0MANARMY
Ah, I see. Well, I dislike the Areas folder, so then Spark does it all so much better :-) I guess you can configure it yourself somehow, or if not - download the source and compile it the way you want it...? ;)
Arve Systad