by dasil003 · 14y ago · 0 comments
Is there any reason while the Ruby 1.8 behaviour that duplicate variable names are allowed was changed? This seems a much cleaner way of allowing this construct.
Because in general allowing duplicate argument names is a terrible idea and a rich source of bugs?
> This seems a much cleaner way of allowing this construct.
I feel the exact opposite. A privileged 'disregard' symbol gives you the power of signalling that you don't care about certain arguments, without the 'shoot-yourself-in-the-foot' side effect of easily accidentally shadowing what you intended to be distinct entities.