So far in programming (Swift for iOS) for async functions i've been using two callbacks to handle the completion of the async function. One is executed if the function completes without error ("success") and the other if the function errors ("failed").
I've noticed that node.js uses error first callbacks where the first parameter of the callback is an error which is null if no error occurs. It then comes down to the user to check if the error is null and handle the situation appropriately based on the result of this check.
My question is; is there any reason, in the realms of optimisation or best practices in programming, to use either of these methods over the other, or does it come down to personal preference and consistency?
Personally I can't see how it would matter that much either way but my concern is I may have missed something.