I’ve spent the last few weeks driving around a Lexus for the first time, and I’m not exactly sure what to think about it.
On the one hand it’s very powerful, in the sense that it permits you to code your entire website as if it’s an application and not html. Every page has a CodeBehind page that lets you work in the exact same way that you would on a desktop application. And the HTML side of the page barely needs any HTML at all. In fact, you can get away by using ASP.Net controls almost exclusively, including for such simple things as links and images. And those controls, by default, will just post back to your codebehind page, just like wiring up events on a GUI form.
I can see why ASP.Net developers like it.
On the other hand, it completely ignores all established web development conventions. The very things that make it nice for a lot of developers are what make it a poor fit for web development if you use it in the default fashion. Many of the things which make ASP.Net convenient fly in the face of the way you’d do development on any other platform. To many, I’m sure that’s a good thing. It’s easier to set up an ASP.Net control, set runat=”server” and just catch the OnClick event in the Codebehind and do your thing than it is to learn how to set up an HTML form and learn to set the form’s Target, give it a submit button and make sure whatever page is the target has code to catch a form submission but do something different when it’s just being hit directly. I get that.
But the way ASP.net handles a lot of this just outright breaks things that would be otherwise simple. First, a primer. ASP.net controls are, in essence, pieces of .Net code that get rendered by the server at page load and turned into html at that time. So while your page may have an ASP:LinkButton for your link, when it gets sent to the broswer it’s a straight link tag.
Now, you can use regular HTML with ASP.Net and create rational webpages with it. It’s not a broken platform, exactly. The problem is that because these Desktop App style crutches exist, people use them when they shouldn’t. The site I worked on is filled with ASPisms that, on reflection, bother me a lot. Pressed for time and lacking experience, I fell back on those crutches because they were the closest tool that could get the job done. I think one day I’m going to pay for those choices.
ASP.Net feels like a web development platform designed specifically for the Visual Basic coders of the 90’s. People who have a low tolerance for new ways of doing things and little interest or ability to step outside of their comfort zone. It’s web development for non-web developers. It lets you build a desktop application that shows up in someone’s browser. At least, its default configuration is.
What that default configuration leads to is a lot of programming that works fine in desktop applications but is clunky and slow over a network. ASP.Net promotes inefficient web code by allowing you to work within parameters that aren’t optimal for the web, and giving you all the tools you need to stay there forever. We have an internal website which is terrifyingly slow for what little most clicks do, and most of it can be tracked back to ASP.Net letting our developers build it as if it were a desktop application.
You could do some excellent work in ASP.Net, but I believe that by doing so you are probably avoiding many of the things that were the reason you chose it in the first place. I could avoid using ASP.Net controls and do things in a more purely HTML way, but that’s just breaking the paradigm Microsoft set up. If I’m going to do that, I’ll use a platform that was built to integrate with HTML more naturally.
I understand the world ASP.Net is meant to live in. I just don’t like it all that much.