Not logged in (Log in or Sign up)

unwwwritten

misguided neatness

A minor complaint to get things going again...

Why is it that programmers feel the need to line a series of assignments up in columns?

   1  a.id      = b.id
   2  a.foo     = b.foo
   3  a.baz     = b.baz

This is a completely misguided effort.

Why? Look at this changed version...

   1  a.id                          = b.id
   2  a.foo                         = b.foo
   3  a.baz                         = b.baz
   4  a.something_else_really_long  = b.foobar
  1. the introduction of a long member screws with your alignment and if you want to be anal about it, you'll wind up committing a change to more lines than necessary as you add extra spaces to the existing line

  2. look how far your eyes have to travel to see what's being assigned now... lots of room to accidentally look at the preceding or following line instead

  3. it's not really that hard to read the code without that extra whitespace... the assignment operator acts as a natural column divider anyway

   1  a.id = b.id
   2  a.foo = b.foo
   3  a.baz = b.baz
   4  a.something_else_really_long = b.foobar

Cheers.

blog comments powered by Disqus