Re: Alignment Nazi?
"Jeroen Wenting" <[email protected]>
| Newsgroups | gmane.comp.programming.language-of-the-year |
|---|---|
| Message-ID | <[email protected]> |
--- In [email protected], "gjmilne64" <gjmilne@...> wrote: > > I am an Alignment Nazi. When I see a block of code like this: > be prepared to meet mister black helicopter, mr alignment nazi. > > I find it so much easier to read when I change it to this: > I find it much easier to read if it contained a bit more whitespace in the form of linebreaks... > The question I want to ask is "does my need for visual clarity excuse my > fetish for alignment of equals signs in blocks of code"? > nope. Generally only functional changes should make it into version control. Especially if you're dealing with languages where whitespace is significant :) > My personal justification is that I can more easily assimilate the block > of code if the left-hand side of variable names is clearly separated OTOH it makes it a lot more work changing that code as every time someone comes up with variable name that including its type name is longer than anything that's already there an ever expanding block of code needs to be rewritten to please your fetish. Makes tracking diffs a lot harder when half the sourcefile changes every time someone touches it just to make it match his personal layout preferences. > Perhaps I should write a book (or blog) on the merits of "Pretty Code". > "Pretty" in this case is in the eye of the beholder. I'm averse to unnecessary whitespace and consider this style to be largely unnecessary. Blame my ASM and Cobol origins, maybe. Jeroen Wenting