ASP.NET MVC reminds me of old Classic ASP spaghett

2019-02-01 03:02发布

I just went through some MVC tutorials after checking this site out for a while. Is it just me, or does MVC View pages bring back HORRIBLE flashbacks of Classic ASP spaghetti code with all the jumping in and out of HTML and ASP.NET with yellow delimiters everywhere making it impossible to read? What ever happened to the importance of code/design separation?? I was really sold on the new technology until the tutorials hit the View page development section.

Or am I missing something? (And don't say you can use the template to help because it's jsut moving the spaghetti to another location - sweeps it under the rug - it doesn't fix the problem)

14条回答
孤傲高冷的网名
2楼-- · 2019-02-01 03:35

MVC vs. generic ASP.NET like the difference between automatic and manual transmissions. Use a manual if you want to determine which gear to use for which purposes, when to shift, and optimize for efficiency. Use the automatic if you want something that just works but may not be very well optimized, or flexible, or easy to debug (which you won't need to do as often.)

Classic ASP was a manual transmission with only second gear.

查看更多
等我变得足够好
3楼-- · 2019-02-01 03:35

Because the people behind MVC really liked ASP/JSP pages and want to implement it all over again. They appear to hate:

  • ViewState
  • Existing ASP.Net Controls
  • Clean Html
  • Existing User Controls
  • Postbacks

They appear to love:

  • Re-inventing the wheel
  • REST-ful urls

MVC essentially is a way of forcing a separation of code from presentation. If a developer actually cared enough, this could be easily acheived with normal Asp.Net. It is possible to punk the whole "separation" system anyway, so I don't really see the point.

That being said, there is some merit to it.. but not enough to outweigh the problems. MVC version 3 I'm sure will be awesome.

And before anyone marks me down -1, see how many MVC questions I've answered. I know what i'm talking about.

UPDATE If you are taking your separation seriously, upon looking at it, chaiguy1337 is onto a good thing. String Template looks great because it does not allow any code in your front end! In my opinion, the ASP.net MVC team dropped the ball on MVC.

查看更多
登录 后发表回答