(no title)
jpatte | 9 years ago
Example:
def printPlayerLineup(playerPositionByNames)
batOrder = 1
playerPositionByNames.each do |name, position|
puts "#[name} bats #{batOrder} and plays #{position}"
batOrder += 1
end
end
There are also a few tips to give about how to pick good names. For example if you expect an array of player names the argument should be called `playerNames`, not `players`. Another example is function names should always start with a verb.Also, if you end up writing comments just to specify types, consider using a statically typed language instead.
NateDad|9 years ago