Faster for() loops?

I can't claim to speak for everyone in the group, obviously. Every newsgroup post has an implicit "IMHO" attached. But I think it's a fair summary of the opinions of the group, or at least of those who post regularly. And very few people object to top-posting when it is appropriate - it is just the definition of "appropriate" that they disagree on...

Anyway, the key point with posting etiquette is to be (reasonably) polite and informative, and to remember it's a conversation between real people. If, as is normally the case, top-posting makes it unnecessarily harder for people to follow the sense of a post, then it is impolite and uninformative, just like posting in SMS or all caps. If top-posting makes a reply easier to read, then it is appropriate (although usually snipping would be far better).

Reply to
David Brown
Loading thread data ...

I prefer to compare Boolean values against zero or FALSE.

if (boolean_flag != 0)

means just exactly the same thing as

if ( boolean_flag )

and should be easy enough to read.

--
pete
Reply to
pete

common

over

tests

Actually, with values of a boolean nature, I prefer to do it Steve's way:

#include

int a_toi(const char *nptr) { int n;

n = 0; while (isspace(*nptr)) { ++nptr; } if (*nptr != '-') { if (*nptr == '+') { ++nptr; } while (isdigit(*nptr)) { n = 10 * n - '0' + *nptr++; } } else { ++nptr; while (isdigit(*nptr)) { n = 10 * n + '0' - *nptr++; } } return n; }

--
pete
Reply to
pete

Don't disrespect our group wishes.

*plonk*

Brian

--
Please quote enough of the previous message for context. To do so from
Google, click "show options" and use the Reply shown in the expanded
header.
Reply to
Default User

I'll ignore, for now, the built-in type _Bool and the standard header introduced in C99.

A value used as a condition in C is treated as false if it's equal to zero, true if it's non-zero. It's not 0 vs. 1, it's 0 vs. anything other than 0.

If your variable "boolean_flag" is something other than zero-is-false, non-zero-is-true, it shouldn't be called "boolean_flag".

Assuming boolean_flag is a proper condition, "boolean_flag == TRUE" isn't just pedantic, it's positively dangerous. The relational operators always yield 0 or 1, but other boolean expressions can have any non-zero value; for example, the is*() functions in return 0 for false, but can return any arbitrary non-zero value for true.

Any compiler that does treat them the same is badly broken (unless the compiler is able to prove that the value of boolean_flag is either 0 or 1).

This is a different issue from using something that's not a boolean flag as a condition, such as "if (!ptr)" rather than "if (ptr == NULL)", or "if (count)" rather than "if (count != 0)". I prefer the more explicit comparison, but both forms are perfectly valid and equally safe.

See also section 9 of the C FAQ.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org  
San Diego Supercomputer Center               
We must do something.  This is something.  Therefore, we must do this.
Reply to
Keith Thompson

Oh, so calling someone "clinically thick" over something so trivial is somehow respectful?

Show some respect for others. *Then* you'd be entitled to talk to me on the subject.

Steve

formatting link

Reply to
Steve at fivetrees

'king 'ell - Some people.

If you are going to "*plonk*", why do you have to broadcast it. That's the equivalent of putting your fingers in your ears and going, baaaa! bblaah! I'm not listening!

Plonker.

Reply to
Joe Butler

Exactly my point. Thanks for making it clearer than I managed to ;).

Steve

formatting link

Reply to
Steve at fivetrees

Reply to
Richard Henry

I suggest you take a look at this thread to see what really happened.

Joe Butler was asked not to top-post. He replied with a top-posted followup. Someone else again reminded him not to top-post. His response, in article , was, and I quote, "prick." (and it was, of course, top-posted).

There are good reasons for our convention (here in comp.lang.c) of discouraging top-posting; I won't repeat them here. There are also good reasons for not insulting people who are offering good advice. If you've come into the middle of this discussion, it might not be clear what's going on; groups.google.com can help you.

I suggest we drop this. I don't believe there are any relevant points that haven't already been made.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org  
San Diego Supercomputer Center               
We must do something.  This is something.  Therefore, we must do this.
Reply to
Keith Thompson

Well, "toby" snipped too much of the previous post. What I wrote makes only sense when you can read the bits that he removed as well.

(Hint: The last line of a joke is usually not very funny if the beginning is missing).

Reply to
Christian Bau

If you could see what toby replaced with three dots, then my post would have made much more sense.

I suspect that "toby" didn't get the joke that was there before he snipped the part that I had been responding to.

Reply to
Christian Bau

Ah. Mea culpa. If the disrespect I reacted to was in response to insulting behaviour, then I apologise for leaping to the defence of the offender.

Fully agreed.

FWIW: I understand and agree with the reasons for discouraging top-posting. However I've grown far more tired of the flamefests that result from top-posting than of top-posting itself. My patience ran out when I saw what I thought was an over-the-top response. I was wrong; I apologise.

Steve

formatting link

Reply to
Steve at fivetrees

I think my post was mangled by some stupid idiot with a room temperature IQ. And I mean Celsius.

Reply to
Christian Bau

Reply to
Walter Banks

Oh dreidel, dreidel, dreidel I made it out of clay And when it's dry and ready Then dreidel I shall play!

It has a lovely body With legs so short and thin And when my dreidel's tired It drops and then I win!

Oh dreidel, dreidel, dreidel I made it out of clay And when it's dry and ready Then dreidel I shall play!

My dreidel's always playful It loves to dance and spin A happy game of dreidel Come play now, let's begin!

Oh dreidel, dreidel, dreidel I made it out of clay And when it's dry and ready Then dreidel I shall play!

Reply to
Anonymous 7843

Let's put this into perspective.

Althought I don't know how to verify this, I suspect many 100s, perhaps

1000s, of people read these posts.

Only 2 or 3 people told me not to top post. That's 3 out of 1000? 3 out of

10,000? Who knows. That suggests to me that the vast majority of people don't give a damn. Probably, like me, the vast majority are easily able to deal with all the forms of posting and it is, therefore, not an issue for them.

I understand that top-posting annoys some people. For me, when someone who's only contribution is to butt in with something along the lines of "space corp. directive one ex delta nine has been violated", that is infinitely more annoying than any other person's posting style.

The only input 'Default User' (prick) gave at that point was, "You need to get the other point, the one about not top-posting". If Default User had any sense, he would have realised that I had chosen to ignore the advice about top-posting, that it was not the first time that I had been told and, therefore, it was a pretty pointless exercise to step in at that point.

Sincere regards to everyone.

the

Reply to
Joe Butler

Apologies, you're right: I didn't realise that the error was intentional. Too subtle for me at that moment...

Reply to
toby

Don't know about majority, personally when I see a post that hard to make sense of I'll just skip it and jump to next one...

Tom

Reply to
Tom

out of

people

to

for

Agreed. Life is too short to waste time un-mangling the conversation.

I have already kill-filed Joe Butler. (yes, I know that's is a rude thing to say - it's part of my point, here) I have no idea how many more of the 100s or 1000s who read c.a.e and c.l.c have also done so.

Oddly, the first post I see in this thread from him he has snipped and bottom posted (unfortunately, without proper attribution for what he was responding to). It is only his later posts that flaunt the etiquette of these groups.

Bob

Reply to
Bob

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.