Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Sutto/124031 to your computer and use it in GitHub Desktop.
Save Sutto/124031 to your computer and use it in GitHub Desktop.
# 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