Skip to content

Instantly share code, notes, and snippets.

@mbriggs
Last active August 20, 2020 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbriggs/662ff6cba2a31a23425b9b41e92b7640 to your computer and use it in GitHub Desktop.
Save mbriggs/662ff6cba2a31a23425b9b41e92b7640 to your computer and use it in GitHub Desktop.
# this is similar to lisp, implicit return is super natural
def this_is_expressive(arg)
if arg
query_one(arg)
else
query_two(arg)
end
end
# this is imperative, every line does a thing, making the last line expressive doesnt fit at all
def this_is_imperative(arg)
if !arg
result = query_two
return result
end
val = arg + 10
other_val = arg + 20
result = query_one(val, other_val)
return result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment