Do you need to go back to Javascript school?

by Paul Browne

Related link: http://www.firstpartners.net/blog/category/web/web-20/



Admit it, you probably looked a Javascript in the late 90's , thought it was good for a few narrow areas (special effects on a web page, validating user input) and then went elsewhere to program in a 'real' language. If asked, we'd complain about lack of language features and the restrictiveness of running only within a client side browser.

While we were concentrating on Enterprise Java Servers and Scalable web apps, the awkward teenager that was Javascript (complete with spots and braces) has grown up. This author included, we only started paying attention again when Ajax burst upon the scene. Whatever your choice of server side language (be it Java, Ruby, .Net or PHP), it's undeniable that Javascript is running the show when it comes to Web 2.0 and dynamic web applications.

So, it's time for me to go back to school and understand what the language has to offer. A good start is an article available on VSJ. It blows away the myth that Javascript is not an Object Orientated language. While Ajax is cool, if we don't structure our code properly then we failed to learn any lessons in architecture from the last 5 years.

Me, I'm off to write 100 lines in detention: 'Java is not the only Object Orientated Language'.




Has Ajax rekindled your interest in Javascript?


2 Comments

joshuawait
2005-12-23 10:54:26
Everything Else Has Finally Come of Age
Javascript has probably had all of the elements necessary for implementing AJAX since 2002. Doing some quick research (and perhaps inadequate on my part), it looks like Internet Explorer 6 was released in 2001. That would mean that the JScript variant of ECMA script has supported the XMLHttpRequest method since 2001.


So if some variant of the core JavaScript language has supported this method for the last few years, then why hasn't it been implemented earlier? Has Windows Update driven people to new browsers? Did JavaScript's relegation to validation tool limit its adoption?


It wasn't that long ago that many small web design shops that I knew refused to use anything other than tables for layout and design. CSS was only for idealists. Although the acronym AJAX doesn't include CSS in its name, CSS plays a critical part in all of the examples of AJAX that I've seen.


It wasn't until this last Fall that Macromedia made implementing CSS from the design mode in Dreamweaver a reality. At one time, I heard the statistic that 60% of all websites had been designed with Dreamweaver. While some people may be hard core coders, many people rely on their design and development environment to provide functionality. Without the presence of a good visual CSS editor, my guess is that many designers would skip using it.


Javascript's inability to fetch data from a server has always been a major frustation for me. I can't tell you how many times new web developers have come to me and asked "How do I save data from JavaScript?". The answer has always been "Press the submit button and send the form". I didn't even know that XMLHttpRequest method existed because when I learned JavaScript no book, website or person ever mentioned it.


So perhaps JavaScript hasn't really grown up. Perhaps the environment around it has.

paulbrowne
2005-12-24 11:26:32
Everything Else Has Finally Come of Age
Good post Joshua.


My understanding is that most of the parts needed for Ajax have been around for the last 5 years (see my article on Java.net - http://today.java.net/pub/a/today/2005/10/27/sprinkle-ajax-magic-into-struts-webapp.html).
If you count some hacks using frames instead of XMLHttpRequest , Ajax tricks have been around even longer than this.


What has changed is that Google starting showing what can be done with Ajax techniques. What is interesting about this is not that everybody paid attention the new possibilities when Google demod them in Mail , Maps , Predictive search etc. - to some extent this is to be expected. Rather, it is the fact that Microsoft had similar technology (available in the Outlook web client) available years before this (I'm unsure of the dates , but I would say 2001 onwards).


When I first saw the Outlook web client (using Ajax), rather than understand how it worked, I wrote it off as being 'just another Internet-Explorer only Microsoft technology). That should teach me to be more open minded about new technology!