Javascript: Time Traveller From the Year 1962!

[prev] [thread] [next] [lurker] [Date index for 2005/04/08]

From: Michael G Schwern
Subject: Javascript: Time Traveller From the Year 1962!
Date: 23:15 on 08 Apr 2005
Gee, how original, hating Javascript.  But this is a new hate.  A fresh
hate.  A fundamental hate.

I have to touch Javascript for this project.  Sean Burke's written some
mildly positive things about the state of Javascript in 2005 vs 1995 so
I'm going to give it a chance.  The project has existing HTML with the
same JS functions copied into the header of each file.  Ok, simple enough
refactoring, I'll toss each function into its own .js file.  Already
things are looking up!

A lot of pages use most of the functions, so rather than have a ton of
<script src="..."> in each file I'll just write up all.js which does the
moral equivalent of:

	include("this.js");
	include("that.js");
	...

Simple enough, right?  Basic 1970s programming technology.  Include a file.
So I start looking for such a thing.

And looking.

And looking.

And ask some friends.

Finally I get back this:

  function include(jssrc) {
    document.write("<script type='text/javascript' src='"+jssrc+"'></script>");
  }
  include("include2.js");

I have to write my own include function.  This include function isn't even
native to Javascript, it relies on the browser DOM.  I have to cut & paste
this code into every JS file which wants to include another.  I have to
cut & paste code so that I do not have to cut & paste code.

I just double checked, Javascript came about in 1995.  Its up to version 1.5.
There's an ISO standard for it.  At least three multinational corporations 
are actively involved in its development.  AND IT HAS NO INCLUDE FUNCTION?!

In related news... Lua.  NO NAMESPACES!  WHAT THE HELL PEOPLE?!  The
tables-as-namespaces makes Perl 5's OO system look clean and well thought 
out.

Are the designers of these languages all TIME TRAVELLERS FROM 1962?  The 
next big thing in language design: variable names with more than eight 
characters!

Generated at 12:00 on 12 Apr 2005 by mariachi 0.52