Wednesday, May 05, 2010

From the keyboard of the Galumph - The joys of web development

Manx, cool cat without a tail.

Jorthy is a little busy tonight and I've decided to blog in her place. I promised a software related post (in-fact serialization in dotNet) so here it is.

I'm a professional developer, I've spent 13 years writing, testing and managing enterprise software and teams. I've recently moved to a non-profit organisation where it’s back to hands on, no more staff managing, or yelling at staff that their quality is poor. My first project is sorting out the mess of an existing ASP.NET project.

As per most software projects you firstly tackle the low-hanging fruit like ensuring the software you write is the software that moves into Production and placing version numbers on everything. Beyond this you get down into the coal face and start sorting out problems. Crystal Reports versioning (yuk), Microsoft SQL database replication (fun!) and actually writing code. The language forced upon me is ASP.NET written in Visual Basic .NET.

The worst part of web based products is trying to trace any problem. Let me explain what happens when a web page you visit is rendered.

The below is server side code, relatively easy to write and debug.

1. The page is called. e.g. blah.aspx, or blah.php

2. On the server, the code is executed in order that the programmer decided. There are page initialisation, page load, control events and then closing events like page render.

3. From all this code a stream of HTML code is delivered to your browser with all the fields pre-populated from the database (of choice) and fields available for entry, nothing fancy, just HTML with some client side code (see below).

4. The gods then have a hand on whether the HTML your server has created is actually fit for the client browser (Internet Explorer, Firefox, Opera, Chrome, and all their versions) to consume which it often isn’t - I'll save that for another time.

Next comes client side code (the magic!), hard to write and impossible to debug. As we have become accustomed to web sites behaving like Microsoft Word, Excel, Outlook (or any other Windows/Mac/Linux application) we expect instant gratification, so when I tab off this field I want it validated, or like in Google that as I type I want it to search for the keywords.

This, my crafty friends is the nightmare. You are as a developer in serious trouble if you want to 'step through' the code, or 'break' the code. Its back to programming 101 where you insert friendly 'I'm here' dialogs throughout your code to tell you what is happening, it can take hours searching for a stray ), or ;.

Where the 1st class language we’ve been promised? This unfortunately is why software development has become more labour intensive, not less. It basically comes down to the fancy things we want out of web based applications. If you wanted it on a standard Windows, Mac, or Linux environment it would be much simpler, but due to deployment and cross platform issues everything must be web... oh and don’t forget, make it run like Microsoft Word.

I love my job!

11 comments:

  1. Sigh. I have one night off drinking wine with my brother(and inbetween times reading the Persephone catalogue)and THIS IS WHAT I GET?????

    Apologies for the nerdiness dear readers. The husband will pay.

    ReplyDelete
  2. Well Galumph, at least the tools are getting better. When I worked on my first ASP/VB project in 2000 it was a spaghetti code nightmare. And as for debugging, remember errors like "Method ~ of ~ failed", yeah, so helpful. Java stacktraces were a revolution!

    Have you tried using jQuery.debug for debugging client side code? I've heard good things.

    Yay nerds!

    ReplyDelete
  3. Booo hiss! Get your own bloody blog, Galumph.

    ReplyDelete
  4. I think you totally should start up a blog Galumph!

    ReplyDelete
  5. After gentle pressure from Mrs HB, I've been told to leave a comment.
    Well my first comment is that I'm happy to see the impresive Lego content of the blog (to the annoyance of Mrs HB), especially the apparent guest appearance of a circa 1980's spaceman. see lego post and another spaceman and more. However I never remember the yellow or blue spacemen in my childhood.
    Back to what I think I've been more asked to comment on. My two answers are jQuery & MVC. jQuery is definitly the way to deal with client side HTML and a good book is 'jQuery in Action', MVC is the only technology I've seen that adds any structure to ASP.NET and a good book that explains the fundemental concept shifts behind MVC is 'Pro ASP.NET MVC Framework' (however there's probably now newer books that tackles MVC2).
    While you may already have a large amount of existing classic ASP.NET code, you should look at where possible to start migrating to a better world.

    ReplyDelete
  6. Um.... what he said.

    ReplyDelete
  7. You lost me somewhere in the first paragraph. But I do like cats. Though I prefer the Rexs, (literally) cool cats with a coat!

    ReplyDelete
  8. Anonymous3:50 pm

    Hang on to this guy Jorth!

    ReplyDelete
  9. Well. Wasn't that fascinating.


    :p

    ReplyDelete

Leave a comment! Make my day!