optional "function" keyword

Claus Reinke claus.reinke at talk21.com
Sat Mar 10 07:25:09 PST 2012

>>  Surveying other libraries would be helpful.
> Yes - enough guessing - I'll do my best to do some counting with different
> libraries (both for DOM and for nodejs) and report back some numbers.  Erg
> - busy work : )

Surveying is useful in the sense of visually comparing code versions
with/without different short function proposals.

I doubt that (simple) statistics are equally useful here, though: the 
syntax is sufficiently awkward that programmers actively avoid using the
very code patterns that short functions would help to make readable.

With the large range of avoidance patterns (from preferring named
callbacks over control-flow libs all the way to preprocessors), proper
statistics about the pain that could be avoided by improved function
syntax would involve non-trivial amounts of inspection/interpretation
and rewriting.



More information about the es-discuss mailing list