Francis Glassborow wrote:
In article <11**********************@p79g2000cwp.googlegroups .com>,
Ninan <ni****@yahoo.com> writes Is this a good design for myClass in the example below? Are
there better alternatives for m_oA and myCallback? struct
apiA, and function apiFn () are not in my control, as they
are standard api supplied by the exchange for which I am
writing the application. Also the member variable m_oA
logically belongs to myClass
This post is a wonderful example of how too much whitespace is
as bad (or possibly worse) as too little. I do not have the
time to reformat the code and without doing that I find it
unreadable.
Well, it's one of the easiest formatting problems to correct:-).
I am pretty sure that the problem (every line of source code
has an extra blank line added to it) is not an artefact of my
news-reader but an artefact of cutting and pasting from an
incompatible source code editor.
As the moderator who accepted this post my hands were tied
because format is not a reason for rejection, but perhaps
readability ought to be. We can reject for excessive source
code, perhaps we should also have an allowance for rejection
for too many blank lines:-) What do others think?
It's a sad fact of life that some of the tools we use mangle
formats. I don't think that there's anyway to avoid it
completely. Code without any indentation is worse than the
extra blank lines, and at one time, Google stripped all leading
white space when posting. Once I realized this, I started
inserting a '|' at the start of each line in a code example.
But sometimes I'd forget, and of course, there were a lot of
postings before I'd realized that there was a problem. In this
case, while the problem might be in the copy/paste, as you
suggest, I wouldn't put it past his newsreader to have inserted
an extra empty line before any line which didn't start in the
first column. In which case, I couldn't possibly have been
aware of the problem before seeing the posting appear.
And if you reject because of extra lines, what about because of
wrapped lines---things like:
std::cout << "In callback " << pA->a << " " << pA->b <<
std::endl;
or
//Simple illustration only. In real life callback fn will be
called later pA->a = 18;
I find that this plays even more havoc to readability,
especially when what is wrapped is part of a comment. And
there's an awful lot of newsreader software which silently
wraps. Sometimes just visibly, so the poster thinks everything
is formatted correctly, but the posting contains lines with a
couple of hundred characters, or more.
So while I agree with you that it's not nice, and I think that
we should lobby newsreader providers to do the right thing, I
don't think it reasonably, today, to reject such postings.
--
James Kanze GABI Software
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
[ See
http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]