Why not error first callbacks?
stereosteve opened this issue · 3 comments
Hello -
This package looks very nice for implementing simple token based authentication, and I am looking forward to trying it out. The readme was very helpful, but after the first read over the docs my question is why not use the standard error first callback style?
The getUser method has a signature like
getUser: function (username, successCallback, errCallback) {}
And in validatePassword, the callback takes arguments:
callback(userObject, errorObject, password)
Do you think it would be more consistent with node convention to use error first callbacks?
getUser: function (username, callback) {}
// and the callback takes
callback(error, user)
And for validatePassword, the callback would look like:
callback(error, user, password)
Any reason why you chose to not use this style of callbacks?
Steve
Look forward to your feedback on using the module. Like most others, it was simply a "scratch your own itch" solution to a problem.
Why did we use the
function (username, success, err) {}
instead of
function(username, callback) {}
?
To be honest, I don't remember, it was just what we did. I am not wholly convinced it is worth breaking backwards compatibility for it, though.
Take a look at the 0.6.0 and up release, completely changes it. Is that what you mean?
Open several years, closing this out.