Skip to content

Instantly share code, notes, and snippets.

@TheCubicleBuddha
Last active August 30, 2019 17:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save TheCubicleBuddha/d6a32fc44e3cd0f95c134442b70d782e to your computer and use it in GitHub Desktop.
This demonstrates code that is not "communicating it's needs." To see an example is upfront about it's requirements, check out the solution at: https://gist.github.com/TheCubicleBuddha/c03a1ac37550f8a34df08a3b03915f40
function martyrAlgorithm(newUserToSave){
if(!newUserToSave.lastName){
throw new Error("I did my best, but I can't save this new user since you didn't get me a lastName")
}
globals.databaseHandle.save(newUserToSave);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment