Forked from mlambie/Where do the parentheses go (if anywhere)?
Created
June 5, 2009 03:41
-
-
Save Sutto/124031 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
# Recursion | |
# I usually put them around method arguments | |
def recursive(x) | |
return if x >= 10 | |
puts x | |
recursive x + 1 | |
end | |
# No Brackets here | |
recursive 0 | |
# But brackets here | |
recursive recursive(1) | |
# Also as of note, In classes I usually explicitly use self.something even when not needed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment