Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
laggyluke
· 11y ago · 0 comments
You might want to reconsider your Node.js callback API. The standard way of returning errors is via the first argument :
callback(err, data)
while you suggest doing it like this:
callback(data, err)
Apart from being an eyesore, it breaks compatibility with a ton of third-party libs like `caolan/async`.
Comments
[–]
cloudgeek
11y ago
Hi laggyluke, thanks for your comment. I'll check with a few developers I know - most of what I've seen has been the reverse but I'm not in node on a daily basis. Cheers
[–]
woah
11y ago
Just check the node docs.
[–]
cloudgeek
11y ago
Got it, changing now. Thanks
[–]
cloudgeek
11y ago
Thanks for the education laggyluke, much appreciated