3 ms·
I wonder why you bother posting things like this here of all places. I agree with you, I'm an MVC3 and a Rails developer - I put food on the table for my family
by sergiotapia 14y ago
I wonder why you bother posting things like this here of all places. I agree with you, I'm an MVC3 and a Rails developer - I put food on the table for my family using both (and even sometimes CakePHP).
The amount of sheer idiocy in this thread is really surprising considering the website.
It's like people see "Micro$0ft", foam at the mouth, and start rambling on about FOSS. Without even using MVC3 for anything substantial.
To compare Razor with any other view engine and say it's more or less the same is SO IGNORANT it makes my blood boil; especially since people are upvoting those same stupid remarks.
How can you compare Razor's elegant syntax with Rails really smelly view engine:
@foreach (var person in Model.Friends)
{
<p>@person.Name</p>
}
- irahul 14y agoHow can you compare Razor's elegant syntax with Rails really smelly view engine: @foreach (var person in Model.Friends) { <p>@person.Name</p> } Wow. That's revolutionary. Iterating over a collection. /s
- vidarh 14y agoERB (one of a ton of view engines you plug into rails): <% Model.friends.each do |person| %> <p><%=person.name %></p> <% end %> Or: <% for person in Model.friends %> <p><%=person.name %></p> <% end %> I don't even like Rails, but I fail to see how that is "really smelly". Or as I prefer Mustache, I'd probably rather pass Model.friends to the view as a variable and do: {{#friends}} <p>{{name}}</p> {{/friends}} But regardless what engine you do, you'd be hard pressed to find any big differences in terms of iterating over a collection. I find it very hard to believe that you're a Rails developer yet somehow find the above syntax so much more elegant that you'll use that as an example of how rails has a "really smelly" view engine.
- sergiotapia 14y agoYou don't see how uncomfortable for the hands it is to type `<%` and closing `%>` every single time you want to output something using code? How can you compare that, to a simple `@` symbol? ERB (or even Mustache for that matter, feel like a relic compares to Razor.
- irahul 14y ago> You don't see how uncomfortable for the hands it is to type `<%` and closing `%>` every single time you want to output something using code? How can you compare that, to a simple `@` symbol? ERB (or even Mustache for that matter, feel like a relic compares to Razor. I don't think you are doing an objective evaluation. 1. All goddamn editors can be configured to do a short key for the expression(I have mapped \1 to `<% %>` and \2 to `<%= %>`) 2. If that is too much of work, use Haml http://haml.info/tutorial.html http://haml.info/tutorial.html or Slim http://slim-lang.com/ http://slim-lang.com/ # slim - persons.each do |person| p = person # haml - persons.each do |person| %p = person
- sergiotapia 14y agoYou're comparing something that comes out of the box (Razor) with something you can achieve comfort with after wiring up hotkeys and snippets. That's not a fair, clinical comparison. Are you kidding me? Slim looks like something much MUCH better than the crufty old ERB.
- irahul 14y ago> You're comparing something that comes out of the box (Razor) with something you can achieve comfort with after wiring up hotkeys and snippets. And what difference it makes if it comes with Rails or I have to add an entry to Gemfile? Ruby has many different templates. What comes bundled with Rails is totally up to creators. DHH is opposed to haml https://twitter.com/dhh/status/58289541068492800 https://twitter.com/dhh/status/58289541068492800 and hence, erb is the default which is unlikely to change. They don't even have to accommodate alternate templates(which they do seamlessly). Do you cry a river every time you have to use a library which doesn't come bundled with .net? > Slim looks like something much MUCH better than the crufty old ERB. And it's better than Razor's crufty syntax as well. But please keep tooting your horn about your Razor. I have wasted enough time here.
- deleted 14y ago[deleted]
- 14y ago