max-mapper / callback-hell

information about async javascript programming
http://callbackhell.com
847 stars 100 forks source link

Adds an additional benefit of naming functions #17

Closed c4milo closed 9 years ago

welll commented 10 years ago

@c4milo, Do you know if it can be achieved without naming function? Like assign the anonymous function to a variable.

c4milo commented 10 years ago

As far as I know, no.

welll commented 10 years ago

I don't think that naming functions is the only manner to identify the culprits... Anyway, I can check and make a test using a profiling tool. What do you think?

For example, suppose we have a function waiting a callback arg

function test(err, callback){
...
...
callback();
}

I THINK that I can do the code below and the profiling tool will work in the same way:

var x = function(){....};
test(null,x);

I think is not necessary creating a naming function like:

function y(){
....
}

test(null,y);
c4milo commented 10 years ago

Well, I did my own tests using https://github.com/c4milo/node-webkit-agent and the names were not showing up. Maybe I'm missing something.

welll commented 10 years ago

@c4milo, I have never used the the node-webkit-agent... Anyway, can you show me how to execute the tests? Do you throw an exception to get the stacktrace?