Hay (Husky) wrote:
Javascript might have gotten a bad name in the past because of 14-year olds who used it to display 'Welcome to my website!' alerts on their Geocities homepage, but it's really unfair. Javascript is a very flexible and dynamic language that can be written very elegantly.
I urge everyone who still think Javascript is a toy language to read Douglas Crockford's excellent article:
Not very convincing.... "There are already too many versions. This creates confusion." "Design Errors" "Lousy Implementations" "Substandard Standard"
"But many opinions of the language are based on its immature forms." Admittedly true for me. Never want to use it in production again.
On Wed, Jul 1, 2009 at 10:35 AM, Gregory Maxwellgmaxwell@gmail.com wrote:
...
- Doesn't inflate the number of languages used in the operation of the site
This is the important checkbox, as far as integration with the project (my first criterion), but is the server side code already running JavaScript? For serving pages?
- Possibility of reuse between server-executed and client-executed
(Only JS of the named options meets this criteria)
I'd actually put this down as a negative. In my experience, for security, clear division between client and server is required. I've participated in too many projects that thought it would be cool, and then spent a good part of my time building firewalls between client and server to eliminate bad assumptions about validity of the other side.
My general rule: coming over the network, presume it's bad data.
Double/quadruple/octuple that for any data that is then executed as a script. In effect, build an interpreter within the interpreter to validate the code before execution of the code. Never fun....
- Can easily write clear and readable code
Not in my experience. And we have far too many examples of existing JS already being used in horrid templates, being promulgated in important areas such as large categories, that don't seem to work consistently, and don't work at all with JavaScript turned off.
I run Firefox with JS off by default for all wikimedia sites, because of serious problems in the not so recent past!