Last active
August 20, 2020 20:16
-
-
Save mbriggs/662ff6cba2a31a23425b9b41e92b7640 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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