Created
January 18, 2012 21:28
-
-
Save jhuttner/1635784 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getName(callback) { | |
client.select('name from people', function(err, result) { | |
if (err) { | |
callback(err); | |
return; | |
} else { | |
// process result | |
} | |
}); | |
} | |
// VERSUS | |
function getName() { | |
err, result = client.select('name FROM people'); | |
if err: | |
return err, false; | |
else: | |
return null, result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment