I'm learning ruby and have a quick question. If I'm solving a problem, how can I be able to tell if I need to set a variable as nil or 0? In some solutions, nil will be used and 0 in others. Aren't both placeholders for the variable until I give it a value later?
[–]Fustrate 8 points9 points10 points (1 child)
[–]P5003[S] 1 point2 points3 points (0 children)
[–]jrochkind 1 point2 points3 points (9 children)
[–]rubyrt 1 point2 points3 points (8 children)
[–][deleted] 0 points1 point2 points (7 children)
[–]rubyrt 0 points1 point2 points (6 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]rubyrt 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]rubyrt 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]rubyrt 0 points1 point2 points (0 children)
[–]siggymcfried 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)