
- Image by ttrentham via Flickr
I’ve always, for some reason, felt innately that PHP allowed me more control over my code than ASP.NET. My brain kept saying “but .NET is more organized! It compiles! It’s faster! It’s easier to write,” but my mind kept saying “PHP lets me do what I want how I want it… screw .NET!”
What I finally figured out was that I love C#, I even like the .NET framework, but I hate is, in fact, ASP.NET.
Every time I see an example of simple, elegant code, the most complex control on the page is a label or a panel. While the intentions behind FormView may be good, writing my own forms and hooking them up saves hundreds of lines (literally- I just refactored almost 800 lines of code into 150 by removing a formview) as well as reduces complexity and maintenance (now I no longer have to maintain view and edit and whatever other modes FormView has.) ASP.NET perhaps made sense in a day before OO principles and ORMs came into play; the controls were written for the same kind of people that use the drag-and-drop design mode. Easy to slap down haphazardly, not so easy to maintain.
We replaced every ASP.NET Ajax control we used anywhere (after I evangelized it, to my chagrin) with jQuery after about 6 months of use; while the controls did what we needed on the surface, underneath there was always some caveat, like the linked DropDowns needed web services, or the datepicker control had missing options… there was always something somewhere that I needed a bit of flexibility on that just wasn’t there, or was buggy. It seemed very odd for it to be out of beta in such a state. So, I ended up starting my own control library using jQuery, and now it’s easily extensible, easy to modify from the client, and I can control the markup.
Oh, and the markup… don’t get me started on the markup. Tables for everything. I can’t rearrange the otherwise useful Wizard control because it’s so static in its display.
So, I guess the point I’m trying to make is, that the longer I use .NET, the less and less I use the complex controls and the more I roll my own. Because it’s easier.
Kind of ironic.
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=4d9cd1b1-cc21-4241-b625-e55c125fd955)














#1 by Eric Wroolie on February 15, 2010 - 12:34 am
Quote
Jack I completely agree with you. I was having this conversation with someone a few weeks ago.
My big problem with ASP.Net is that it abstracts the idea that ultimately you are just sending html to the browser. I’ve had so many developers tell me that they can’t do something because they don’t know how to do it in a gridview.
I use ASP.Net all the time. I love the idea of data binding. I love using C#– it feels natural.
But I hate the Page_Load event. I hate post-backs. I hate controls that render html I have no control over. Most of the controls hardly seem necessary. You could easily use basic HTML (although controls like the calendar control and wizard control are very cool).
PHP is closer to the HTML (like classic ASP was). You know what’s going to the browser. But PHP is an ugly language. It doesn’t compile. The object-orientation feels like it was cobbled together at the last minute ($variable=>”foo”).
I really like the way they move away from all this with the MVC framework. No code behind pages and few controls.
#2 by Jack Lawson on February 16, 2010 - 11:20 am
Quote
@Eric Wroolie:
Thanks, Eric- we’re definitely in agreement. Page_Load, postbacks, no control over html… but the temptation for easy controls exists (though they come back to bite you later.) And that’s my predicament: PHP is definitely a very ugly language. So my choice is between bloated complexity vs. ease of use… have to lesser of two evils based on the project.
I’m working on a few MVC projects to get more familiar with the framework; it looks like it’s the magic solvent. I hope it is, anyway.
#3 by Jhon Barreiro on April 15, 2010 - 3:35 am
Quote
Definitely, Definitely, I share your HATE over asp.net controls. I also do use pure HTML as much as possible and I try NOT to use thos .Net server controls simply because the are ugly!