Is it getting harder and harder to show very easy examples?

I am right now teaching a four day class of DOM and Ajax in Sunnyvale, California and also do some tech editing for Scriptin with JavaScript and Ajax by Charles Wyke-Smith and I find one thing that is pretty worrying: easy examples of web development practices are dangerous to show these days.

I’m talking about practices that make it easy to get quick results and give readers and attendees “I am getting this – this is easy” fuzzy warm feelings.

One very obvious example is form validation and re-rendering of a form using PHP_SELF and displaying user data using $_GET or $_POST. Unfiltered they are a free invitation for any XSS attack and will turn your server into a spam-hub or bot-net drone. Explaining countermeasures of XSS normally is out of scope for an example that only shows how a form would work that you enhance progressively.

The same applies to simply outdated ideas like onevent handlers. It is easy to show an example that uses a few onclick handlers, but explaining event handling really well takes a bit of time. Again, this is something that really does not fit in the scope of a DOM course.

I do however think that it is important to get it in there, as there is no such thing as knowing one technology in the web development stack and being able to use it. There’s a lot of overlap with other areas and in order to be a good developer and play well with others you need to be aware of your effects and areas of overlap with your colleagues’ skill-sets.

The other extreme I find myself doing is being too over-cautious. I went through the tough times of the first browser wars and got a deep-rooted mistrust towards anything some browser tells me is OK to do and use. However, I get the feeling that it doesn’t really matter any more if Internet Explorer has a problem with name vs. ID or whatever other shenanigans we have to be aware of when we build things from scratch.

I do get the distinct feeling that not building on top of a good client-side library is simply a waste of time these days. Libraries allow us to write code, not to work around bugs and wonder what other safety measure we have to put in.

That’s why I started asking people in my courses to use Firefox with Firebug and use a good text editor to code along. Today I managed to breeze through how to write HTML that is ready for internationalisation and works with assistive technology, over simple DOM access to the document and at the end writing a validation script for a form using generated DOM content. By concentrating on how things are meant to work instead of debugging random issues I managed to get the students to reach far into the matter in a day – even those who never touched JavaScript before.

Maybe it is time to get beginners accustomed to a market that builds on working solutions and benefits from browser abstraction via libraries than teaching developing from total scratch – bad browsers and bad people taking advantage of any technology to gain access or spam us seem to have made this way of working redundant.

Tags: , , , , , ,

View Comments to “Is it getting harder and harder to show very easy examples?”

  1. Drew Says:

    Hi, first of all I totally understand what you mean. I am kind of learning the whole ‘internet programming’ thing and client side programming is much more of challenge than I ever imagined, essentially because of the inconsistancies between browsers, especially IE and in particular IE6.

    The libraries do really help this but if you were to learn from scracth using a library then do you not run the risk of not really fully understanding whats going on underneath? Maybe the steeper learning curve is worth it in the end.

  2. Kmett Says:

    I really enjoy the philosophy behind this post. I believe that so many developers try to reinvent the same libraries believing they can build something better when all they end up doing is building it one way that then exposes them to hackers in another form. It’s a vicious circle!

  3. HobbesPDX Says:

    I want to take a class [from you] about the DOM & events. They are EXACTLY what I am trying to learn. I know HTML and CSS inside & out, and I have a firm grasp of programming concepts (PHP, C & VB), but am JUST learning JavaScript, by way of jQuery. I want to do this right, and really grok the DOM. When do you come to the US? :)

  4. Dan Brady Says:

    What’s great about starting to learn now, is that you passed over a LOT of quirks and hacks from back in the dark days of spacer gifs and browser sniffing. And even though there are still issues today, libraries and standards are invaluable. Although, I would still recommend to others to spend sometime learning javascript from scratch before moving on to using libraries. There’s still plenty of cases out there when using a library would be overkill.

  5. denig0o (Denise Knight) Says:




    Wait till I come! » Blog Archive » Is it getting harder and harder… [link to post]

    Posted using Chat Catcher

blog comments powered by Disqus
Christian Heilmann's blog – Wait till I come! is the blog of Christian Heilmann , a developer evangelist living and working in London, England. Download vcard.

Feed me, Seymour: Entries (RSS) and Comments (RSS).