Skip to content

Instantly share code, notes, and snippets.

Created April 3, 2014 22:56
Show Gist options
  • Save anonymous/9964524 to your computer and use it in GitHub Desktop.
Save anonymous/9964524 to your computer and use it in GitHub Desktop.
AllThatIsWrongWithImperativeCode
// result is never used, can this line be removed?
val result = calculate(input)
update(input)
save(input.child)
foo()
// can the above four lines be re-arranged in a different order?
// can foo even be deleted?
@robotlolita
Copy link

That you are required to know what calculate, update, save and foo do internally to be able to reason about this snippet of code is the point here. Such a thing would not be required in e.g.: Haskell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment