2 ms·
It's debatable whether aligning the mapping operator - be it a colon or a hash rocket - is a good idea to begin with. The point has been made in the past that i
by kleiba 16y ago
It's debatable whether aligning the mapping operator - be it a colon or a hash rocket - is a good idea to begin with. The point has been made in the past that if you edit the map so that the longest key changes, you'd have to realign all other entries too. For code versioning, e.g., in shared development, this creates unnecessarily large diff's. For instances, patches become more difficult to read, because they include lines that haven't actually changed content-wise, just layout-wise.
- jrockway 16y agoFor code versioning, e.g., in shared development, this creates unnecessarily large diff's. For instances, patches become more difficult to read, because they include lines that haven't actually changed content-wise, just layout-wise. Well, no. Here's an example. File a: { foo => 'bar', hello_world => 'OH HAI', } File a with a long key added, let's call it b: { foo => 'bar', hello_world => 'OH HAI', longlonglonglong => 1, } Then we do a diff: $ diff -uw a b --- a 2011-01-06 08:51:55.725595229 -0600 +++ b 2011-01-06 08:51:52.285595452 -0600 @@ -1,4 +1,5 @@ { foo => 'bar', hello_world => 'OH HAI', + longlonglonglong => 1, } So see, that's not a problem.