I'm having trouble finding an authoritative example or discussion of this concept. If I have 2 variables in my Ruby method that are numbers, and I need to initialize them to zero. They will be used as counters. Is this OK or safe? It works in my tests.
Instead of this:
foo = 0
bar = 0
You can do this?
foo = bar = 0
It seems like a nice way to save on lines and still be expressive. Or, is this a bad practice? I realize I would be sacrificing readability a little. But, in a small Ruby method (<10 lines), that might not be a valid concern.