From: John P. <pet...@cf...> - 2008-02-25 22:14:48
|
Hi, One of my pet peeves (which I am always writing) is code like this: afunction(true, false); You have to go look up in the header file for each arg's definition. I'm gonna start making an effort to document that stuff like this afunction(/*read_header=*/true, /*your_mom=*/false); which seems nice b/c you can usually get the parameter names from the header and then drop in the C-style comments. Is that bothersome to your sense of style? Do you prefer multiple lines like this afunction(true, // read_header false); // your_mom ? I like the first one b/c it fits on one line and you don't have to worry about spacing so much, but I won't change it in a bunch of places if everyone else hates it. Thanks, John |
From: Roy S. <roy...@ic...> - 2008-02-25 22:34:59
|
On Mon, 25 Feb 2008, John Peterson wrote: > You have to go look up in the header file for each arg's definition. > I'm gonna start making an effort to document that stuff like this > > afunction(/*read_header=*/true, /*your_mom=*/false); > > which seems nice b/c you can usually get the parameter names from the > header and then drop in the C-style comments. Is that bothersome to > your sense of style? Do you prefer multiple lines like this > > afunction(true, // read_header > false); // your_mom > > ? I like the first one b/c it fits on one line and you don't have to > worry about spacing so much, but I won't change it in a bunch of > places if everyone else hates it. If adding the C-style comments doesn't cause one line of code to need to be broken into multiple lines of text, I think I prefer that. If there's no way to avoid multiple lines, I don't have any preference between C/C++/no comments. --- Roy |