in reply to A Question of style.
And I personally don't find it helpful to have open and close curlies line up vertically. I find it very annoying to scroll to some point in a file and see something like
Huh? Is that part of an if, while, for, or ? Oh, right. The important part is just above the top of the screen. I'd much rather have the close curly line up with the keyword.{ ...do something... . . }
But, as many others have pointed out, that's all a matter of religion1. So to actually add something useful to this topic, I'll assert that everyone should try out a couple of different styles. And not just for a file or two. Personally, I have to stick to a style for about a month to get through the full set of phases:
After I (unwillingly) went through a couple of those series of phases I listed above, I actually found it very liberating to be able to shift between styles fluidly to match whatever existing code I encountered. There are too many barriers to working with other people's code already: programming language, NIH syndrome, portability, licensing, .... You do not want style to be yet another one.
Open source projects are great for this, since there are undoubtably several out there that interest you for personal reasons, and aren't written in your preferred style.
1 And what's the one thing that all religions have in common? That's right, they all hold that they are right and all the rest are wrong.
2 On the other hand, this helped my typing speed immeasurably. Whoever could type faster would be able to gradually convert the codebase to the One True Style.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A Question of style.
by GrandFather (Saint) on Jun 09, 2005 at 20:45 UTC |