Elsewhere, an argument has arisen over the terminology of a named function in CoffeeScript. In particular someone referred to something like this:
foo = ->
console.log("bar")
as a named function. But its been objected that everything in CoffeeScript is anonymous functions and there are no named functions. This is certainly true, CoffeeScript only has function expressions which can then be stored in a variable. But I don't think that means it is wrong to call this a named function.
As I see it, it is a named function because its a function that has been given a name. True, its not a named function in the same way that some other languages have named functions, but I think its close enough that it's not inappropriate to call it a named function. To insist otherwise just seems to be nitpicking.
Am I out to lunch in thinking that insisting that this isn't a named function is just nitpicking?
foo = ->
is just a plain old function, whilstclass Foo
is a constructor. I see no reason whyfoo = ->
should strictly be called anonymous.