January 2007

Javascript: A Plea for Sanity

Look, pay attention folks. Javascript is a great, powerful little language (simillar in many respects to that other great embedded scripting language Lua). Unfortunately, due to its history, and various bits of maltreatment by some of its users, it’s gotten an absolutely filthy reputation as a language you just “copy and paste” with, and can just “hack” with (in the worst/false sense of the word).

Also, most developers simply dont care. Javascript is just that after thought language you have to use when you get down to the presentation layer on your enterprisey web application (all the SERIOUS stuff is done in C#/Java/[insert your SERIOUS ENTERPRISE LANGUAGE here]). So you just hit the web and copy and paste some code, maybe include one or more AJAX libraries here and there, and who knows, somehow get the stupid thing working.

Urgh.

That hairball of Javascript that you tangled together is someone’s maintainence nightmare. If there is any justice in the world, it will be YOUR maintenance nightmare. So if you are going to write Javascript, how about taking the time, care and attention to at least get the basics right, and code in a sensible, safe and professional way? It really isnt that hard at all, and there are some great resources out there to help you.

The very least you can do is read Simon Willisons’ presentation and notes from his ETech Javascript Tutorial. If you haven’t done any Javascript in a while, this material is gold.

If you really want to get the full lowdown on Javascript, read this book:

The 5th Edition was published in August last year, and its the single best Javascript book I’ve seen. It covers pretty much everything, the core language, client side scripting, AJAX, the works. Good stuff.

openjsan.org is the JavaScript Archive Network - “a comprehensive resource for Open Source JavaScript libraries and software”. So if you are going to reuse some Javascript code, you can do it in a modular way and not using horrendous copy and paste hack hack hack “methodology” every scriptkiddie with a modem was using back in 1995.

Other libraries you might want to check out for slick AJAX’y goodness include:

So there you have it. A list of useful resources to help you get some Javascript mojo. .

javascript
softwareengineering

Comments (0)

Permalink

A Secret History of… Java

An interesting account of the history of Java’s development at Sun.

Every significant development project has many interesting stories behind it. Most of these are lost or remain known to a few people involved in the project. Later on when other people look at the design or the actual code of the project, they will often think “What the hell were they thinking?” or perhaps “Why didn’t they include feature X, Y and Z?”.

Commercial software development doesn’t occur in a vacuum; political and marketing concerns can change the product being developed. This isn’t always a bad thing. Remaining in business by hacking together a mess of a proof of concept, is infinitely preferable to having to put people out of a job.

I’m always interested in hearing or reading about the stories behind projects, and have read quite a few books on various projects. When I get round to setting up a page for recommended books, I’ll link up to some of the better books I’ve read.

secrethistory
java
sun

Comments (0)

Permalink

.NET on OSX

So it seems that there is quite a bit of excitement about bits of news regarding a version of the CLR that runs on Apple’s OSX.

As I commented on Paul Wilson’s .NET blog, I don’t think this is any real attempt to support .NET on OSX. I can’t see how it could ever be in MS’s interest to do so, nor do I think Mac users want generic portware that common platforms provide. Look at the success of Java on OSX for applications. It’s a non-starter.

Fortunately for people like me, who need to write C# code and prefer to do so in an OSX environment rather than Windows, there is the excellent Mono project. An open source port of .NET and C# being supported by Novell. Short of running Windows in a Parallels VM, this is the best way of writing and running .NET code within an OSX environment.

technology
osx
.net
c#

Comments (0)

Permalink

SQLite3 for OSX and Rails

I ran into some problems using SQLite 3 and Rails on my OSX box the other day. The problems are easily fixed by upgrading SQLite to version 3.3.9. The following blog posts were all invaluable in saving me a load of time and hassle:

sysadmin
osx
databases
rubyonrails

Comments (0)

Permalink