|
EBay has asked users to change their passwords following a cyberattack that compromised one of its databases.
That has got to hurt the ol' pride glands.
|
|
|
|
|
So depressing. Every week there's a new hack or leak from a major website. Ready for this to end!
|
|
|
|
|
Why should I use anything other than ASP.Net? "Less typing" is NOT an acceptable answer. What tangible benefits are realized by going with an alternative view engine? Since they all have to essentially provide the same functionality, I don't see the value of picking one over another.
I know - Razor is used a lot. But why? What makes it better?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
John Simmons / outlaw programmer wrote: But why? What makes it better?
Keep in mind I'm more of a Unix guy over the web, and I've only done like one Razor project a while back...
Less typing means less room for error and cleaner code that's much easier to maintain. New constructs that make life easier, like a lambda, that has minimal penalty on performance are awesome. But, performance is king, that's why I'll never bother with something like Ruby, over the web at least. No amount of syntactic sugar can make up for slow.
Jeremy Falcon
|
|
|
|
|
MVC View Engine is:
1. Light weight
2. Separation Of concern using Model.
3. UI Injection Or View Injection
Life is all about share and care...
public class Life : ICareable,IShareable
{
// implements yours...
}
modified 22-May-14 0:19am.
|
|
|
|
|
And how that connected to the question?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Quote: Why should I use anything other than ASP.Net? "Less typing" is NOT an acceptable answer
That's why...
Life is all about share and care...
public class Life : ICareable,IShareable
{
// implements yours...
}
|
|
|
|
|
Again, your answer doesn't make any sense.
MVC is not the "view engine". The default view engines that come with Visual Studio, used by MVC, are "ASPX" and "Razor", not "MVC View".
|
|
|
|
|
Actually I missed the question I have just put features of View Engine...
Life is all about share and care...
public class Life : ICareable,IShareable
{
// implements yours...
}
|
|
|
|
|
You missed the question. It's about why Razor over other view engines.
|
|
|
|
|
Oooo
Life is all about share and care...
public class Life : ICareable,IShareable
{
// implements yours...
}
|
|
|
|
|
Great answer.
Suvabrata Roy wrote: Light weight
2. Separation Of concern using Model.
3. UI Injection O View Injection
You have to understand the PageController pattern to understand how you are limited by ASP.Net and why you would move to Razor / MVC. Once you understand the problems (so nicely summarized above) then you'll know.
Basically, PageController (ASP.Net) says, oh, you sent me this URL I am going to send you some HTML.
Whereas, in Razor / MVC the server sasy, Oh, you sent me this URL, I am going to do whatever the custom controller behind me says to do (calculate a value, return business objects (JSON), etc.)
ASP.Net basically returns only the view because it is a PageController pattern.
http://martinfowler.com/eaaCatalog/pageController.html[^]
|
|
|
|
|
Thaks sir...
Life is all about share and care...
public class Life : ICareable,IShareable
{
// implements yours...
}
|
|
|
|
|
John Simmons / outlaw programmer wrote: Razor is used a lot. But why? What makes it better?
IMO, nothing.
Razor is ultimately a response by Microsoft et al. "look, we can do MVC too" and open source it, etc.
After having written and worked on several Ruby on Rails apps that employ MVC and all this embedded scripting (erb, slim, whatever) I can definitively say that, while it's slick, it's slick in a sort of slimy, geek-virgin way. Nothing becomes more unreadable faster than HTML embedded with [language of your choice] + JavaScript + jQuery + [whatever] + CSS.
On the other hand, I probably have my head up my arse in not accepting the conventions, the "idiomatic way of doing things"
, which I think is actually "the idiotic way of doing things."
On the gripping hand, I'm taking a completely radical, alternate reality approach. This is what my "view" files look like nowadays:
<%= @style %>
<%= @html %>
<%= @javascript %>
Everything is server-side generated, hopefully as I build up the toolset, from a re-usable library of standard behaviors.
Oh, and the abstraction of MVC is awesome, the reality sort of sucks, because it's actually more typing, not less, and it's amazing how many corners a cube can have in which you can paint yourself into, and then make really ugly workarounds because pure MVC leaves some horrendous skid marks when the rubber hits the road.
I'll stop now.
Marc
|
|
|
|
|
Marc Clifton wrote: After having written and worked on several Ruby on Rails apps that employ MVC and all this embedded scripting (erb, slim, whatever) I can definitively say that, while it's slick, it's slick in a sort of slimy, geek-virgin way. Nothing becomes more unreadable faster than HTML embedded with [language of your choice] + JavaScript + jQuery + [whatever] + CSS.
Even though I'm now gravitating towards Fux , proper MVC should minimize this in the view layer. It's the old-school, dump it all in one file, way of thinking that becomes a serious mess.*
* Not that I'm a fan of RoR.
Jeremy Falcon
|
|
|
|
|
I'm somewhat the completely opposite. Server side should provide data only. The data display and handling should be done on the client.
there is no problem to build a re-usable library of standard behaviors with javascript.
modified 20-Oct-19 21:02pm.
|
|
|
|
|
Marc, well put.
Have you noticed how programmers LOVE puzzles and complexity? Seeming for complexity's sake? Or maybe it's for job security. The more difficult coding is the more secure your job and career.
Software vendors don't really have ANY incentive to make things simpler, better, or easier. On the contrary, it's in their commercial interest to make things as difficult and complex as possible so customers and users get "locked in" to their eco-system. So where's the progress to next generation software going to come from?
Have you also noticed how open source really does not generate new ideas just coding versions of existing ideas?
And why don't people start really innovative open source or even semi-closed source projects to take us to better coding and better software?
Could your project be a joint project that would help us all?
- Grant
|
|
|
|
|
C Grant Anderson wrote: Have you noticed how programmers LOVE puzzles and complexity? Seeming for complexity's sake?
Sometimes I think that complexity naturally evolves because people are really bad at analytical thinking, which creates unnecessary complexity resulting from bad design/implementation. I can see that very thing happen with systems I've worked on, and it takes effort to force myself to re-architect rather than create complexity with patches. This, BTW, is why I hate refactoring.
C Grant Anderson wrote: It's in their commercial interest to make things as difficult and complex as possible so customers and users get "locked in" to their eco-system.
Agreed. But it doesn't need to be difficult or complex, just deeply embedded. If I start using DevExpress controls, or build a website using Twitter-Bootstrap, there's no way I'm going to switch mid-stream. Well, maybe with DevExpress I could if had the foresight to wrap its controls in an abstraction layer.
C Grant Anderson wrote: Have you also noticed how open source really does not generate new ideas just coding versions of existing ideas?
Mostly true. There is some really innovative stuff out there, but nobody uses it for that reason, unless it's really necessary for the project.
C Grant Anderson wrote: Could your project be a joint project that would help us all?
That's the intention. I started goofing around with the idea in Ruby on Rails[^] and have been poking around with a C# implementation using the HtmlAgilityPack, but it's still in its infancy. I'm also looking for people to donate time to this innovative work[^].
Marc
|
|
|
|
|
I'm surprised no one has stated one of the biggest advantages that you get out of the MVC side over ASP.NET - no ViewState by default. Man, what a fetid pile of crodspittle ViewState is and it's amazing how many people never bothered to turn the darn thing off.
|
|
|
|
|
Pete O'Hanlon wrote: Man, what a fetid pile of crodspittle ViewState is and it's amazing how many people never bothered to turn the darn thing off.
Or more accurately: (*&q#(*@$View(*&^&(*&^&**%State&*%%^&%**
Let's see how many people get it.
Jeremy Falcon
|
|
|
|
|
I think I misspoke - I meant the ASPX *view engine* as opposed to ASP.Net.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Ah, I possibly misunderstood. I'm rushing to get a release out the door and while the CI build is underway, I'm answering posts. I really should have given an eminent gentleman like yourself more attention.
|
|
|
|
|
Pete O'Hanlon wrote: I really should have given an eminent gentleman like yourself more attention.
And the fact that JSOP uses guns should be a more encouraging factor to give him more attention.
|
|
|
|
|
Given the vast distances involved, I'm not that worried.
|
|
|
|
|
As long as you don't breach my 600 yard security perimeter, you're fine.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|