Confessions of a bad web developer

December 21st, 2007

I’ve been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my “Road to Damascus” incident. I don’t know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up. More importantly, I know a ton of asp.net controls. What I don’t know, specifically, is how they all work.

Like the form tag. I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed). But I don’t remember how to use it any more. How to read data from it, pass values from one page to the next. I used to, did it a few times in fact. Then came Asp.Net, and I haven’t looked back.

Have I written JavaScript during this time? Sort of. If you count copying code from Google (and testing it of course). Over the years I have large blocks of Googled JavaScript code in existing projects that I’ve move from page to page. Cut-and-paste is a type of reuse…right? And lately, when my JavaScript requirements have not been Google-able, JQuery has become my savior (more posts on that soon). But I haven’t written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify. I once wrote my own tree control in JavaScript. Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE. I never thought I could hate a language until Netscape. Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can’t do without it anymore. And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn’t going to work for you. Take a look at the Google Maps API and tell me you aren’t thinking of things that could be done with it. But it ain’t going no where without some JavaScript know-how.

CSS I have come to terms with. I know the difference between .tag and #tag. I’ve written a hover or two. But there are still unknowns there as well. I still visit w3schools regularly, and spend way too much time with FireBug and Fiddler. And CssZenGarden — that is just beyond me right now.

But even in Asp.Net. How does a post back work? How is it that a button click is hooked up to an event handler? I’m a firm believer that their is no “magic” in programming. Post back is magic to me. Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which? Heck, how do I figure that out on the client side with JavaScript? The magic is ViewState, I know. But…

That really is the beauty of WebForms. It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript. ViewState is my friend. But what does this have to do with Asp.Net MVC? Absolutely everything.

Asp.Net is a stripped down version of web development with .Net. ViewState: gone. asp:Button: hope you are familiar with submit. The cozy jacket is gone and has been replaced with a wind breaker. All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature. Part of it as well, is knowing that you have to work in the cold climate. So this isn’t time to put things off. Spring is still a ways off. So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn’t need to know that well:

  • XHML
  • CSS
  • JavaScript
  • JSON
  • JQuery
  • Asp.Net Ajax framework

I’m not going to specify particular books. I don’t have time for that, and you can search Amazon as well as I can. Actually, I bought a couple of these books for $1 at Hastings near my house. Worth every cent.

Also worth noting what is not on my list: XML. The language we thought was the lingua franca of the web. I’ve had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller). So XML is out for me. And that is fine, I think, there is enough to learn as is.

  • Pingback: AJAX coding school » Blog Archive » AJAX Code [2007-12-22 06:47:08]

  • Sergio Pereira

    On the Javascript side, there’s no point in trying to write Javascript these days without a good library. You can write web pages in .Net without System.Web, but would you?
    note: I think you meant JSON not JASN.

  • http://elegantcode.com Chris Brandsma

    Hi Sergio,
    Thanks for the catch on JSON, is fixed now. And as for Javascript in general, I’m sticking with JQuery for now. It just makes things so much easier it isn’t worth it anymore.