Microsoft's new "Razor" View Engine

17 views
Skip to first unread message

HarveyK

unread,
Jul 3, 2010, 4:31:25 AM7/3/10
to Spark View Engine Dev
Microsoft's newly announced ASP.NET MVC view engine Razor:

http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx

Louis, @ Microsoft do you also work on Razor development? What's the
future for Spark, if any?

Louis DeJardin

unread,
Jul 3, 2010, 6:11:58 AM7/3/10
to Spark View Engine Dev
Nope, I'm working full-time on the Orchard CMS. I am on the internal
discussion list, have shared some opinions and thoughs on some
threads. But in terms of design, implementation, and the future -
Spark and Razor are totally unrelated.

Specifically to the question - what is the future of Spark - nothing
has changed. Relocation and creating a CMS has been fairly time-
consuming, so I haven't had the same kind of spare time as before, but
it's a personal priority of mine to keep the code rolling and alive.

So, on one hand it'll be more difficult for people to choose between
Razor and Spark than to choose between WebForms and Spark, for obvious
reasons :), but on the other hand it's also a beautiful view engine
and more options isn't a bad thing.

Jonas Gauffin

unread,
Jul 3, 2010, 6:12:37 AM7/3/10
to spar...@googlegroups.com
Looks better then ASP, but I still like spark better.

The reason is that it's still mixed code (the new tags and html). It doesnt get the same flow as spark.



--
You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.
To post to this group, send email to spar...@googlegroups.com.
To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spark-dev?hl=en.


Rob G

unread,
Jul 3, 2010, 6:24:33 AM7/3/10
to spar...@googlegroups.com
I think I need to blog about the key similarities/differences between the two engines. The main focus being on education - I don't intend to bash Razor, but I do intend to call out direct parallels between the two. 

They say that imitation is the sincerest form of flattery eh Lou ;)

Would you mind if I ran the post by you first when it's done Lou? I don't want to ruffle feathers, I'd much rather get the salient points across.

Happy to take feedback here if anyone has something specific they think I should address?

Cheers,
Rob

HarveyK

unread,
Jul 3, 2010, 9:02:18 AM7/3/10
to Spark View Engine Dev
Thanks for the response, Louis.

We're currently building a new product using Spark as the view engine
and hence the question given your unique position with regard to Spark
and Microsoft.

Adam Schroder

unread,
Jul 3, 2010, 10:56:33 AM7/3/10
to spar...@googlegroups.com
The automatic variables when doing a foreach loop in spark are awesome and are used so much.
eg. blahIndex etc.
I use this code block in nearly every crud page.

<tr each="var item in Model.List" class="even?{itemIndex % 2 != 0}">
</tr>

i hate having to declare the i variable outside a foreach and then increment it. thats the easiest way to create some good spaghetti.

I really hope if nothing else this Razor makes it easier to implement intellisense for Spark.

Adam

Rob G

unread,
Jul 4, 2010, 8:57:00 PM7/4/10
to spar...@googlegroups.com
As I said before, I thought I would blog about my thoughts on this topic:


Feedback most welcome...

Best regards,
Rob

Louis DeJardin

unread,
Jul 5, 2010, 12:30:25 AM7/5/10
to spar...@googlegroups.com

Ah, good times. :)

 

In terms of design queues, though, I think you’d be surprised… Andrew talks about that a bit at http://blog.andrewnurse.net/2010/07/03/IntroducingRazorNdashANewViewEngineForASPNet.aspx

the premise and syntax was well underway before I even started working at building 42.

 

Kind of like how Spark in the early days was compared to coldfusion a lot, along with a few other php template engines with strikingly similar features. I’ll be the first to point out Spark was directly influenced by experiences with NVelocity, and NHaml to some extent, but I hadn’t seen any of the others before. I think the same thing happened with Razor.

 

For myself - I provided some input about some scenarios as they were discussed by the team, but as you can imagine I am far from the only experienced web developer here. And though my input was based on my own background and secondhand from this community, there was never a case where I needed to point to something in Spark and say “you’re missing that”.

 

I appreciate all of the love people have for Spark, though, and I’ve been chuckling to myself quite a bit following twitter over the weekend. Especially since I’ll be bumping into some of the folks that helped bring the new syntax together in the hallways of the third floor on Tuesday. :) I wonder if I should ask if they’ve had any feedback yet?

Rob G

unread,
Jul 5, 2010, 4:36:52 AM7/5/10
to spar...@googlegroups.com
That's what I like about you Lou - humble no matter what. The very fact that you publicly talk about what and who influenced you *is* the point.

You give credit where credit it due and although Andrew sound like a great (and smart) guy. Pretending that this is "their invention" is a little hard to swallow. RE: the design cues (I spelt it wrong), good ideas eventually converge anyways - it's the nature of software, there are normally very few ways of doing something well, but plenty ways to do it badly :)

ScottGu or Andrew could quite easily have started their posts with "We took a look around the ecosystem, and looked at the pain points that were solved by view engines out there like (blah blah blah) and we decided to build something that included those best points and added webforms backwards compat... yada yada yada... and tooling support was easier...blah blah"

No questions asked that kind of thing is received much better by communities. It's a PR exercise, and they could be doing a better job.

I hear you've got a blog post about this coming out soon... I hope you can give us all an insiders perspective without getting in too much trouble.

All the best,
Rob
Reply all
Reply to author
Forward
0 new messages