Real World JavaScript Evolution

The History

Few languages can cause such debate as JavaScript, now a days, everyone is a JavaScript-developer, but it has not always been like that during the cold years between 1999 and 2005. In the early days of JavaScript and browsers we saw some really amazing things being created client-side, and I must admit, some amazingly cruel and bad implemented front-ends as well. A lot of these bad implementations were not due to the use of JavaScript, rather due to developers running the show and lack of guidelines on where and how to use client-side scripting such as JavaScript. In this article I will, with a very subjective view on the topic, guide you through the history of JavaScript and how it come to be that the most hated language in the world ended up as the saviour of the galaxy. The story takes you years back and beware, we mixed content, presentation and behaviour in a way that may not be suitable for the eyes of law abiding and always politically correct standards advocates. We did things such as:

  • Attached events inline
  • Used document.write
  • Alerted when something went wrong (or well)
  • Directly addressed DOM-objects and not trying to create abstract solutions (who needs them! bah!)
  • Used UPPERCASE TAGS
  • Looked at the user-agent string to try to parse operating system
  • Forked element detection depending on browser and DOM.
  • Created recursive functions for finding LAYERS in Netscape 3

If you feel that the list above is way to much for you, head over to W3C, Opera or the Republican Party HQ Online. Ready to go?

The Beginning

Brendan Eich designed JavaScript to look a bit like Java in syntax, but weakly typed and easier for the non-programmer to get started with. The name has little to do with Java except that Sun was involved in the naming back in 1995. JavaScript was first introduced in Netscape 2 and after that the world has not been the same. In the beginning the main area of use for JavaScript in the browser were for validating form data, popping windows, swapping images and adding externally hosted ads to a web page. We still use JavaScript for form validation and ad-scripts. Later in the nineties we saw the term DHTML grow in popularity and DOM-scripting, manipulating the DOM of the webpage dynamically using JavaScript grew in popularity. We saw a lot of games and similiar things being developed. This was when a lot of things were starting to go in the wrong direction. The birth of DHTML more or less happenede at the same time as Internet Explorer 4 and Netscape 4 were released in 1997. If we could dynamically change the DOM on the client-side with a language built for non-programmers we could move the whole control of design to the designers right? There were no limit to the madness me and others took part in. I implemented dynamic scroll areas of content, advanced text-tickers, AJAX-like interfaces with cross-frame-scripting. There were no rules, no libraries, no best practices and no one who saw the boundaries in either direction. Maintenance was just a word. How it all ended? No one had the time to actually look back, because any serious player on the net redesigned their website two or three times every year. There were a lot of work for people who enjoyed writing JavaScript (you did not have to be good at it). There were some approaches to creating libraries such as DynAPI. CSS was just something some people used for stylign fonts (but it was a nightmare getting the same font sizes on different clients), so a lot of the JavaScript code used in order to create DHTML actually added non-semantic HTML to the DOM, and trying to work out how things worked was more or less impossible. The state of JavaScript was that we created amazing things with it, but it was living hell to maintain and when new browsers were introduced the owner of the website more or less had to initiate a redesign and rewrite of the code.

The Dark Ages

After the big crash in 2000 – 2002 you were not allowed to speak the name of the devil. People who still enjoyed solving problems using JavaScript, had to do that locally on 127.0.0.1 and newer, ever show results to anyone on the outside if you for some reason had not met up with other people who fancied the same sick perverted language as your self. Like Gollum we had to hide in the caves. For us, the people who still enjoyed writing JavaScript, it was actually good times as browsers were moving towards standardized ways of implementing the DOM and Ecma, of course with new browser bugs introduced along the way, but it was more or less on the right track. JavaScript in the browser was evolving to become a more or less standardized way of adressing a certain type of problem best solved client-side. As the support for CSS and initiatives pushing for building semantic websites grew stronger, the potential of JavaScript also grew in the caves. During this dark period of JavaScript, semantic built websites meant separating content and design, no one discussed or thought of behaviour, because we were not allowed to speak of the devil. For the big audience and developers JavaScript was something that for some people destroyed the user experience, not enhancing it, in some sense they were right, we only needed to find the correct guidelines and patterns in order to utilize the strengths of JavaScript in the browsers. When everything looked like it was no hope left, a lot of things happened that gave us all a new hope on the evolution and use of JavaScript.

A New Hope

I probably get the chronology all messed up here, but between 2003 and 2006 a lot of great stuff started to happen in the JavaScript world. I think a lot of this new hope had to do with how successful the turn from presentational markup to semantic markup with CSS had been. There was one big problem with standards compability for CSS, that was IE6 (as always the bad kid on the block) and Dean Edwards came up with a JavaScript based solution for the problem which he named /IE7/, the script actually showed the world the strenghts of JavaScript, it actually emulated full CSS 2 support in Internet Explorer 6. We saw a lot of different things that happened during this time that made JavaScript a part of modern web development again:

  • Birth of the term AJAX
  • Ruby on Rails bundling Prototype and Scriptaculous for AJAX and effects
  • Standard DOM (more or less)
  • Birth of generic libraries such as jQuery, MooTools, Dojo and likes
  • Adsense from Google
  • Progressive Enhancement philosophy

All this made JavaScript an natural and important part of the front-end for all web based solutions.

The Enterprise

Once again (2009) JavaScript is on top of the world and now it is a tool all web developers need to know fluently. A lot of todays developers “code jQuery” or “code Dojo” and the libraries has been something that you adhere to from a philosophical approach to coding. What we see now is that the libraries and the engines are getting better and better support from large corporations and organizations such as Mozilla, Google or Apple. We also see JavaScript moving from the front-end to the back-end and the knowledge will be more worth in a couple of years. Today a lot of people are talking about Comet, Mobile JavaScript Support and other new parts to explore in the ever growing area of JavaScript. We see how JavaScript is no longer a play language for non-programmers. I feel that is good in some sense, but also I think that with JavaScript being taking seriously also opens up a threat that it turns into something scary that everything that gets a large developer community turns into after a while. I want JavaScript to be as dynamic and weakly typed as it has been, if it is turned into something corporate I will change focus, I have learned to love JavaScript during the 10+ years I have been working and playing with it.

Epilog

If or when JavaScript looses its playfulness I need a new language to turn to. People have suggested Ruby or Python and I have started to look into these languages, and they look promising, but they are not an alternative to client side scripting. Of course nothing stops me from still using JavaScript even if it turns into something “serious”, it is just not as funny anymore to use a language that once was the only language for rockstars.

Posted in JavaScript | Tagged | 3 Comments

Swedish Web Developer Conference 2009

I am writing this to tip you about the Swedish Web Developer Conference 2009 that are being held in Stockholm (Kista) on the 25th of May. The Conference focus on helping web developers and web designers getting into things such as Dojo, jQuery and CSS, with some really great speakers lined up.

The conference is an initiative by Peter Svensson (who you should follow on Twitter and subscribe to his blog Script Uncle). Peter has done a good job lining up some of the most well known web developers and designers out there. Below you see some of those people listed.

So if you are in Sweden on the 25th of May, head over to the registration form.

Posted in Web Development | Tagged , , | Leave a comment

Twitter Weekly Updates for 2009-04-19

Posted in Tweets | Tagged , | Leave a comment

Twitter Weekly Updates for 2009-04-12

Posted in Tweets | Tagged , | Leave a comment

Twitter Weekly Updates for 2009-04-05

Posted in Tweets | Tagged , | Leave a comment

Twitter Weekly Updates for 2009-03-29

Posted in Tweets | Tagged , | Leave a comment

Twitter Tweets Weekly Updates for 2009-03-22

Posted in Tweets | Tagged , , , | Leave a comment

Twitter Tweets Weekly Updates for 2009-03-15

Posted in Tweets | Tagged , , , | Leave a comment

Weekly Best of – Selected Links

Auto Resize jQuery Plugin

I really like Facebooks implementation of automatic expanding textareas. This auto resize plugin for jQuery helps you add that neat usable effect to your forms.

Typography on the web

Smashing Magazine has a really good list of resources for web typography.

API for Location based on IP

I think we have only seen the beginning of location-based web-apps. This little GeoIP-API helps you geographically locate your visitors.

Screen Scraping with CSS Selectors

This Simple HTML DOM Parser written in PHP makes it easy for you to screen scrape content. For all jQuery and CSS selector fanatics out there, it will be great news for you that it supports CSS Selectors and it supports invalid HTML (if it wouldnt it would be pretty useless).

How to create a leaner User Interface

There is a good list on Webdesigner Depot about different techniques you could use in order to de-clutter your user interface.

Library Independent JavaScript

I found this article by James Padolsey interesting, because I think it is a growing problem. People tend to write jQuery, Prototype now a days, not JavaScript, this is ok for me, but when you are building something that other people will maintain and develop it may be interesting to try to find a development model that are framework agnostic. James has some examples in this article how to create an absctraction on top of your favorite javascript library.

Free Database for IP to Country

Maxmind has free databases for retrieving country and city from the users IP-address. I am using this on a number of websites and believe it is a very good tool for creating more usable web sites and easier to target (and split) advertising.

One Trillion Dollars

One trillion dollars is a lot of money. This article shows you how much it is in real life in volume. Amazing.

Do you have more links I should share or look at? Follow me on Twitter and share your favorite links.

Posted in CSS, Featured, Mobile Web, Web Development | Tagged , , , , , , , , | Leave a comment

Twitter Tweets Weekly Updates for 2009-01-11

Posted in Tweets | Tagged , , , | Leave a comment