I'm very excited and optimistic about html5 (just read http://diveintohtml5.org/ for instance).
Hoping for the same good feeling when catching up on EcmaScript 5, I'm left very disappointed.
For instance just look at what you have to do to create an somewhat ok behaving object:
function Point(x, y) {
return Object.freeze(
Object.create(Point.prototype, {
x: { value: +x, enumerable: true},
y: { value: +y, enumerable: true}
}));
}
That is not nice code!!
I understand that they are some very clever people working hard on this assignment, making it predictable and usable across platforms (browsers) and maintaining backwards compability. But it seems to me that it is the assignment that is plain wrong.
Leave javascript messed up as it is. The '
use strict;' is nice though (and a very appropriately chosen keyword, remembering from where it originates...).
There are tons of good languages out there today, and there is an attribute on the <script>-tag called "type". Why not use it?
My dreamteam:
type="text/groovy"
type="text/python"
Sure it will take time for the world to adopt. But all the more reason to move on from js and get started on something decent. NOW.
