The Accidental Rubyist

invalid byte sequence in UTF-8

Javascript: the good and bad

leave a comment »

Just wrote my first program in javascript (see previous post). Things I liked about javascript:
1. C-like syntax – thankfully!
2. Good regexp classes.
3. Decent handling of arrays, strings, etc. (Although, NO PRINTF !!!)

Problems I faced:

1. While executing, Firefox does NOTHING if there is an error in the file. No error message! It takes me ages to figure out each missing “;” or typo.
2. I tried looking for verifiers, and found several. None have a compile procedure along with the code. Could get none to install on my command line. JSLint comes closest in giving an online textarea which will validate.
But JSlint.com expects me to remove all HTML first. Then it complains about each “==” and insists on my using “===”. It also complains incorrectly about my using the Array(a,b,c) constructor. I have surprisingly not been able to find any utility to help me in finding errors.

3. Vim does NOT indent the program due to the “.html” extension — I have to rename the file to “.js”, indent and then rename back to “.html”.

If anyone has solutions to the above, would be grateful to hear from you.

Mozilla’s current and prior versions use a format called MORK to structure the history data. It has been charmingly referred to by former Netscape engineer Jamie Zawinski as “…the single most braindamaged file format that I have ever seen in my nineteen year career.”

Advertisements

Written by totalrecall

August 26, 2008 at 11:00 pm

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: