u shud c sm ppls' imho bout abbr names. They say you should spell out
IdentifierWordsInFull.
Also you should see other people's opinions about comments. Comments
shouldn't explain what a fact is, they should explain _why_ a fact is. So,
computational complexity was hard.
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
I like to use short names in local scopes, with the declaration a few lines
away from the
only use. All my temporary strings are called s, for example. Two other
favorites are
fmt (for formatting strings) and msg (the result of CString::Format with
fmt).
if(....)
{ /* failed-reason here */
CString fmt(IDS_ERROR_MESSAGE);
CString msg;
msg.Format(fmt, ...whatever...);
...do something with msg
} /* failed-reason here */
I once caused one of my students to fall down laughing. Literally fell
out of his chair.
He and I were working together on a research project, and he was working
on some code I'd
written some months previous. I'd written a loop (in C) to clear a list
Whatever * p;
for(p = ListHead; p != NULL; )
[ /* delete elements */
Whatever * np = p->next;
free(p);
p = np; // and you thought computational complexity was hard
} /* delete elements */
[if you don't get it, it's going to be too hard to explain]
joe
On Wed, 9 May 2007 07:45:39 -0700, "Alexander Grigoriev"
<alegr@earthlink.net> wrote:
If it were formatting only... Extremely abbreviated names (of all kinds),
stuffing operations into a single statement (how do you like *(t=tp) =
0; ),
and so on.
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:ibk243t9g5tcu0hta24rp5q6khrssnt2qt@4ax.com...
I despise almost every aspect of standard K&R style. Politely put, it
sucks. It is an
exeptionally POOR model for good programming style, as far as I'm
concerned. I usually
just reformat anything in this style so it can be read.
joe
On Tue, 8 May 2007 08:08:26 -0700, "Alexander Grigoriev"
<alegr@earthlink.net> wrote:
You wouldn't like K&R accent, would you? Try to read IP stack code from
BSD.
Oh no, you'll get sick.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm