views:

177

answers:

4

It seems that it would be wise to use def, fn, or fun for function definitions similar to Ruby or other succinct languages.

Now that it's too late to change things due to potential compatibility issues, the whole world is forced to suffer using that wasteful long name 'function' everywhere in JavaScript code.

+2  A: 
function reply() {alert("No, it wasn't!");}
aefxx
+3  A: 

"Big mistake"? Apparently not - JavaScript's more popular than Ruby or other succinct languages. The two don't appear to be correlated.

There are lots of things to lament about JavaScript, but "function" isn't high on the list.

duffymo
A: 

Since functions are first class objects "function" seems like a good choice.

ntownsend
+2  A: 

I don't know if I would call it a "big mistake." But I do occasionally wish for something shorter, though. I'd want to use a special syntax, something like |a,b|{return a+b;} or even better, |a,b|{a+b} if it could implicitly determine the return for short expressions.

Sigh...

On the other hand, so we don't go away from this question feeling depressed, isn't it AWESOME how we have great shorthands for object and array literals in javascript? So awesome it brought us JSON! If you ask me, the data structure shorthands are much more important anyway, so cheer up. ^_^

Plynx