elbart / node-memcache

node.js memcached client
285 stars 64 forks source link

Callbacks should be (err, data) instead of (data, err) #9

Closed cjoudrey closed 13 years ago

cjoudrey commented 13 years ago

Hi Tim,

Great module! :)

You might consider this nitpicking, but I believe your callbacks should be of the form function(err, data) and not the other way around function(data, err).

function(err, data) is the standard used in all of the core modules of Node.js and I think consistency of this is important.

Just my two cents,

elbart commented 13 years ago

Hi Christian,

thanks for the advice. You are absolutely right and I should fix that somehow. But first of all we break with all projects using the module already cause these are breaking changes and second I currently don't have time to fix it. Feel free to fork and change by yourself.

best regards,

Tim

rgabo commented 13 years ago

@elbart, you have to fix this. I guarantee you this is the No. 1 reason why people do not end up using this otherwise great module. You absolutely have to follow the Node.js (err, res) pattern because EVERYTHING relies on this. Your API is not usable with other modules, like async.js.

The projects that depend on your library are broken already, if they're using (data, err) instead of (err, data)

elbart commented 13 years ago

thanks again to lackac for his commits - I merged the pull request now and bumped version to 0.2.0