I need help please!

S

santosh

Bill Reid wrote:

[...] First you complain about fflush(stdin), then
you promote its undocumented and "non-standard" use based on a
reliance that it works as "common sense suggests"!

I do not promote the use of fflush on input streams. However, *if* it is
used in a code base (because it's behaviour on all targeted
implementations is desirable enough to be used in spite of the lack of
specification by the Standard), I would expect it to have different
semantics than a loop with getc.

[...]
To be fair I should have included just a little more of the original
code [ ... ]

fgets(yn_input,sizeof(yn_input),stdin);

What if fgets returns NULL?
string_size=strlen(yn_input);

if(yn_input[string_size-1]!='\n') {

See a recent thread on comp.std.c where on certain systems (x86/glibc)
entering two consecutive CTRL-D sequences can cause fgets to return a
buffer without a '\n' character, but with no pending characters in the
system's input buffer.
fflush(stdin);

In the case described above fflush(stdin) (if it does attempt to clear
the input buffer) will behave better than a loop with getc, which will
block for input.
goto ReTry;
}

So you're saying that if we substitute "while(getchar()!='\n') ;" for
fflush(stdin) above, it won't "always work as expected"...OK,
Yes.

that's a little more troll-defensible than "troll-zero"'s statement
that "fgets() is very likely to fail under some circumstances" when
the "circumstances are reading from the standard input...

He is right. fgets reading from stdin will fail if the user enters the
system's end-of-file sequence. You should make allowances for that
possibility if you expect your code to be used by others.
 
F

Flash Gordon

Bill Reid wrote, On 12/03/08 14:49:
Flash Gordon said:
Bill Reid wrote, On 12/03/08 01:54:
Bill Reid wrote:
Bill Reid wrote:
[...]
"Is it possible to write a totally 'portable'
function that will consume ALL the characters left in the standard
input
regardless of platform?"
Yes, barring I/O errors that disrupt the flow of control.

#include <stdio.h>
void eat_stdin(void) {
for (;;getchar());
}
Exactly, some code to that effect, I thought everybody knew this...so
why is it news to all the other posters to this thread but you and me?
If you know how to do the job correctly in one line then you have even
less excuse for posting a non-portable solution.

You trolls really need to coordinate your efforts better...you've got
about three different and mutually exclusive threads of insane troll
logic going here...the above is the "joke troll", and another troll is
now actually ENDORSING fflush(stdin)!!!

Your inability to understand the issues people point out does not make
the logic insane. Your claiming that everyone that disagrees with you is
a troll does not help your arguments.

Santosh was addressing a different point.
Well, probably, but since you and all the other trolls seem to be
completely befuddled by what is essentially just one step up from
a "hello world" program I'm not sure how to evaluate your actual
worth to society...there's not much practical difference between
playing dumb and being dumb, you know...

I see no sign that anyone is befuddled by it. Just your inability to
accept the possibility that people might have valid reasons for
disagreeing with you.
if(yn_input[string_size-1]!='\n') {

fflush(stdin);
goto ReTry;
}

Which is an effective work-alike to:

if(yn_input[string_size-1]!='\n') {

while(getchar()!='\n') ;
goto ReTry;
}

Will that work, or is it too "platform-specific"?
Well, the second case definitely won't flush everything from the input
buffers for standard input on some systems (the buffers, which include
OS buffers, could have more than one line in it on some systems under
some conditions), but it is more likely to meet the real requirements
rather than the stated objective of flushing the buffer.

Well, semantics again, a real problem that I'm willing to let slide,
I wasn't talking about flushing a "buffer", just getting rid of any
unconsumed
characters input by the user.

The buffers I mentioned are where that input is stored. So substitute
"unconsumed characters input by the user" for "buffers" and it still
applies.
If I don't do that, I get a gigantic mess
when I prompt the user to "retry" because the next fgets() just gets
all those unwanted fat-finger characters and the whole thing just
repeats itself needlessly...I woulda thunk that this simple user input

So you think that fat fingers can provide extra input but cannot hit
both the control and Z keys at the same time when they are next to each
other on some keyboards?
requirement would be obvious and could be coded by a PROFICIENT
C programmer in their sleep (for me, I did it many years ago and
I think it took about two hours to get it right,

You produced something that will do what you expect on one specific
implementation.

It has taken me less than 5 minutes to write code to eat all characters
until a new-line in the past, so I would find two hours to do it a sign
of lack of proficiency. Clearing all the characters entered by the user
up until a given point in time is not possible in standard C, so to do
that I would look at whether the requirements are correct, whether it is
possible (my code is frequently run across a network, so there can
sometimes be a delay of a second or more between a key being hit and it
reaching the machine running my software) and what system specific
options there are. I would also clearly comment what systems it would
work on since every now and then my code does get ported and every now
and then new versions of implementations change what extensions are
available.
but I'm an idiot and
NOT a programmer), but then I posted it here, and inane insanity
ensued...

Had you simply accepted that it was non-portable and not argued about it
the thread would be a lot shorter. Of course, had people not bothered to
point out the problems with your code it would also be a lot shorter.
Yeah, I don't do that stuff, so it's not a requirement, and most all of
that stuff is just more bogus trolling AGAIN...

So any requirements other than *your* requirements mean that someone is
trolling? If only your requirements matter then the code is only
suitable for you and so should not be given to others. All of the things
I listed above happen in real life with various degrees of regularity.
OK, I'll take it under "advisement"...you really think that "EOF"
checking is a good idea?

Yes. After all, it occurs in real life.
What'd I say a few posts ago? IT NEVER ENDS!!! As soon as I
fixed all the other non-existent "problems", another troll would pop
up and complain about the "goto"s!!! ARRRRRRRRGHGHHHH!!!!

Again you assume anyone pointing out a problem with your code is trolling.

Messy code is a problem if it is seen by anyone other than the author.
Using goto for what should be a simple loop is messy and does cause
problems. I don't care about whether or not it causes problems if only
the author sees it, but that is not the case here.
What drawback?

That it would just sit there continuously reading character from
standard input until the program is terminated.
So you HAVE heard it! AHA!!!

So are you joking, trolling or insulting professional programmers.
I think it is very unfair of you to characterize stereotypes that way...but

In my experience it is the way most people feel when they are in the
group being stereotyped. That you seem to think that stereotype is
generally true I *do* consider insulting. My experience is also that it
is wrong for the vast majority of professional programmers and a lot of
very unprofessional programmers.
I've already acknowledged that I've met several extremely productive and
knowledgeable engineers in my time, but what do they say about the
exceptions that prove the rule?

If they understand what the expression really means they know that it
means that if there are exceptions the rule is wrong. However, my
experience is that most programmers (whether professional or not) do not
match your stereotype.
 
C

CBFalconer

santosh said:
Bill Reid wrote:
.... snip ...
How about we start REAL slow...I don't know how good you are
at programming and computers and stuff, but here is the fragment
that set off "troll zero":

if(yn_input[string_size-1]!='\n') {
fflush(stdin);
goto ReTry;
}

Which is an effective work-alike to:

if(yn_input[string_size-1]!='\n') {
while(getchar()!='\n') ;
goto ReTry;
}

No. fflush(stdin), if implemented as common sense suggests, will
clear the streams end-of-file and error markers too. It will, most
importantly, not block if there are no pending input characters.
getchar won't do both of this.

Why are you bothering with this? fflush(stdin) just won't work at
all. fflush is intended to work on output files (streams) only.
The code is faulty.
 
R

Richard Heathfield

Flash Gordon said:
Bill Reid wrote, On 12/03/08 14:49:


If they understand what the expression really means they know that it
means that if there are exceptions the rule is wrong.

Um, no. If there are exceptions to a rule, it means that the rule /must/
exist (because otherwise they wouldn't be exceptions to it).

For example, "NO PARKING 10am-4pm Mon-Fri" is an exception, and implies the
existence of a rule that parking is legal in that place for most of the
time.

But Mr Reid is not proving any rules. He is merely begging the question.
 
S

santosh

CBFalconer said:
santosh said:
Bill Reid wrote:
... snip ...
How about we start REAL slow...I don't know how good you are
at programming and computers and stuff, but here is the fragment
that set off "troll zero":

if(yn_input[string_size-1]!='\n') {
fflush(stdin);
goto ReTry;
}

Which is an effective work-alike to:

if(yn_input[string_size-1]!='\n') {
while(getchar()!='\n') ;
goto ReTry;
}

No. fflush(stdin), if implemented as common sense suggests, will
clear the streams end-of-file and error markers too. It will, most
importantly, not block if there are no pending input characters.
getchar won't do both of this.

Why are you bothering with this? fflush(stdin) just won't work at
all. fflush is intended to work on output files (streams) only.
The code is faulty.

That has already been pointed out to the OP, who disagrees that it is
faulty.
 
R

Richard Heathfield

CBFalconer said:

fflush(stdin) just won't work at all.

According to the Standard, the behaviour is undefined. Implementations are
free to make fflush(stdin) do anything they like, *including* what many of
their users expect it to do - and some implementations do precisely that.
(In fact, that's the problem.)
fflush is intended to work on output files (streams) only.
The code is faulty.

Agreed, but that doesn't mean it won't work. (Neither does it mean it
/will/ work, of course.)
 
L

lawrence.jones

Richard Heathfield said:
Implementations are
free to make fflush(stdin) do anything they like, *including* what many of
their users expect it to do - and some implementations do precisely that.
(In fact, that's the problem.)

That's part of the problem. Another part of the problem is that most of
those implementations only *seem* to do what their users expect; they do
something quite unexpected and almost certainly undesirable when stdin
is connected to a disk file rather than a terminal, for example.

-Larry Jones

I think your train of thought is a runaway. -- Calvin's Mom
 
B

Bill Reid

Oh God, what did I say about this NEVER ends...

Flash Gordon said:
Bill Reid wrote, On 12/03/08 14:49:
Flash Gordon said:
Bill Reid wrote, On 12/03/08 01:54:
Bill Reid wrote:
Bill Reid wrote:
[...]
"Is it possible to write a totally 'portable'
function that will consume ALL the characters left in the standard
input
regardless of platform?"
Yes, barring I/O errors that disrupt the flow of control.

#include <stdio.h>
void eat_stdin(void) {
for (;;getchar());
}
Exactly, some code to that effect, I thought everybody knew this...so
why is it news to all the other posters to this thread but you and me?
If you know how to do the job correctly in one line then you have even
less excuse for posting a non-portable solution.

You trolls really need to coordinate your efforts better...you've got
about three different and mutually exclusive threads of insane troll
logic going here...the above is the "joke troll", and another troll is
now actually ENDORSING fflush(stdin)!!!

Your inability to understand the issues people point out does not make
the logic insane. Your claiming that everyone that disagrees with you is
a troll does not help your arguments.

Where have I displayed an "inability to understand the issues"?
I have undeniably displayed GREAT understanding of the "issues".
To aver otherwise is a TROLL, period. To claim that somehow I
am destroying the budding career of a nascent programmer by
posting functional "C" code is also a TROLL, PERIOD.

You can "disagree" with that, but you'd be wrong...
Santosh was addressing a different point.

You all address points at RANDOM for the apparent sole purpose
of TROLLING.
I see no sign that anyone is befuddled by it. Just your inability to
accept the possibility that people might have valid reasons for
disagreeing with you.

I KNOW they don't have valid "reasons". I've covered this TIME
and TIME again. Something that MIGHT happen on another system,
or somebody deliberately trying to terminate a program stupidly,
are NOT "REASONS" to insult a person and claim that innocent
newbies are being misled. In fact, the TROLLS here are the ones
that are confusing and misleading the "newbies"...
if(yn_input[string_size-1]!='\n') {

fflush(stdin);
goto ReTry;
}

Which is an effective work-alike to:

if(yn_input[string_size-1]!='\n') {

while(getchar()!='\n') ;
goto ReTry;
}

Will that work, or is it too "platform-specific"?
Well, the second case definitely won't flush everything from the input
buffers for standard input on some systems (the buffers, which include
OS buffers, could have more than one line in it on some systems under
some conditions), but it is more likely to meet the real requirements
rather than the stated objective of flushing the buffer.

Well, semantics again, a real problem that I'm willing to let slide,
I wasn't talking about flushing a "buffer", just getting rid of any
unconsumed
characters input by the user.

The buffers I mentioned are where that input is stored. So substitute
"unconsumed characters input by the user" for "buffers" and it still
applies.

OK, then I'll just use fflush(stdin) because that has a shot of
working to YOUR specification on MY system, your anal-retentive
highness. Got a problem with THAT? Oh yeah, I forgot...you're
a TROLL, so of course you've got a problem with that, THE ONE
THING ABOUT TROLLS IS YOU CAN NEVER WIN, AND I
CAN'T WIN CAN I?!!?!!
So you think that fat fingers can provide extra input but cannot hit
both the control and Z keys at the same time when they are next to each
other on some keyboards?

Been over this time and time again, but I will admit that because
of certain college training and some of my actual money-making work
I have a greatly more educated approach as to what constitutes a "problem"
that will occur frequently enough to worry about...maybe if you went
back to school and got an actual education, at least you wouldn't have
all this free time to TROLL the Internet...
You produced something that will do what you expect on one specific
implementation.

YAY ME!!! Now my only question is:

WHY DOES THAT BUG YOU SO FRIGGIN' MUCH??!!!?!!

Seriously, what's your problem?
It has taken me less than 5 minutes to write code to eat all characters
until a new-line in the past, so I would find two hours to do it a sign
of lack of proficiency.

That's not what I said, the code to eat all the characters to a newline
took me about as long to type it, maybe a three seconds, and I would
definitely consider anybody who took five minutes to be a drolling retard
that probably WOULD type CNTRL-z when prompted to press 'y' or
'n'...but I've already admitted you guys aren't SMART ENOUGH to
use my brilliant software...
Clearing all the characters entered by the user
up until a given point in time is not possible in standard C, so to do
that I would look at whether the requirements are correct, whether it is
possible (my code is frequently run across a network, so there can
sometimes be a delay of a second or more between a key being hit and it
reaching the machine running my software) and what system specific
options there are. I would also clearly comment what systems it would
work on since every now and then my code does get ported and every now
and then new versions of implementations change what extensions are
available.

Tell the truth, you've never written a functioning line of code in your
worthless life. I mean, how could you, boss walks in, gives you the
simplest assignment possible, months later you're still arguing about
buffers on Ukrainian abacii and the effect of the "I LOVE YOU" virus
on your program and on and on and on and on...

REAL programmers use two digits for year dates in 1996 and
are DONE with it (but waiting for the phone to ring to fix their crap
in 1999).
Had you simply accepted that it was non-portable and not argued about it
the thread would be a lot shorter.

I NEVER ARGUED ABOUT IT, YOU LYING INSANE TROLL!!! I SAID
I PERSONALLY DIDN'T CARE FOR MY PURPOSES!!! I KNOW YOU'RE
STUPID, BUT YOU CAN'T BE THAT DUMB NOT TO BE ABLE TO TELL
THE DIFFERENCE!!!
Of course, had people not bothered to
point out the problems with your code it would also be a lot shorter.

They could have just pointed them out and be done with it when I
said I didn't care about that stuff, since NOTHING that ANY of you
TROLLS have brought up actually constitutes any kind of a REAL
"problem" with the code.
So any requirements other than *your* requirements mean that someone is
trolling?

YES, YOU INSANE TROLL, EXACTLY, FORCING YOUR INSANO
UNACHEIVABLE "REQUIREMENTS" ON ME IN AN INSULTING AND
MISLEADING FASHION IS A TROLL, PURE AND SIMPLE!!! I GLAD
YOU'RE LEARNING!!!
If only your requirements matter then the code is only
suitable for you and so should not be given to others.

SURE IT SHOULD, YOU CREEP!!!
All of the things
I listed above happen in real life with various degrees of regularity.

So are saying there aren't such things as insane trolls on Usenet?
I say they exist with great regularity in this group RIGHT HERE IN
THIS THREAD!!! I have simple and objective tests for trolling behavior,
and applied them to this "real life" situation, sorry...
Yes. After all, it occurs in real life.

JUST LIKE INSANE TROLLS!!!

I'm OK with my much simpler version; standard input EOF just doesn't
occur that much in MY "real life", but if it starts to crop up, I'll be the
first
to make that major change...
Again you assume anyone pointing out a problem with your code is trolling.

THAT'S NOT WHAT I SAID!!!

Great troll though, because for a second you kinda fished me in that
you understood what trolling behavior was...but I shoulda known better...
Messy code is a problem if it is seen by anyone other than the author.

Oh, now it's "messy"...what's next, you gonna call it "icky"?
Using goto for what should be a simple loop is messy

I'm sorry I called you "anal-retentive" because that is an insult
to stool-retainers everywhere...
and does cause
problems.

Sure it does troll. Sure it does...
I don't care about whether or not it causes problems if only
the author sees it, but that is not the case here.

Well, troll, you'd best be policing all the "messy" code posted
here with those "problem" gotos...I expect to see a lengthy post
every time you see a goto here explaining exactly why they
are so "messy" and cause "problems"...
That it would just sit there continuously reading character from
standard input until the program is terminated.

For my purposes, that's not a drawback, that's a feature...
So are you joking, trolling or insulting professional programmers.

Oh, a little from column "A", a little from column "B"...
way...but

In my experience it is the way most people feel when they are in the
group being stereotyped. That you seem to think that stereotype is
generally true I *do* consider insulting. My experience is also that it
is wrong for the vast majority of professional programmers and a lot of
very unprofessional programmers.

How about the fat guy in "Jurassic Park"?
If they understand what the expression really means they know that it
means that if there are exceptions the rule is wrong. However, my
experience is that most programmers (whether professional or not) do not
match your stereotype.

So programmers don't like doughnuts? Hell, I myself like chocolate
icing and the granulated sugar ones (but rarely eat them to try to avoid
looking like the fat guy in "Jurassic Park"), what's the big deal? Man
you take offense easily...
 
B

Bill Reid

Oh, look, "troll zero" is back, the bastard that started all this mess
with his irrational unproductive insults, and he actually proves himself
capable of making a logical distinction:

Richard Heathfield said:
Flash Gordon said:


Um, no. If there are exceptions to a rule, it means that the rule /must/
exist (because otherwise they wouldn't be exceptions to it).

For example, "NO PARKING 10am-4pm Mon-Fri" is an exception, and implies the
existence of a rule that parking is legal in that place for most of the
time.

Yup, must be troll, because trolls know the truth but deliberately
provoke with lies...
But Mr Reid is not proving any rules. He is merely begging the question.

Might be a few straw men in there as well...
 
B

Bill Reid

Refer to my last post about "troll zero"...he ALWAYS knew that
fflush(stdin) is a "non-standard" method of consuming standard
input characters, but chose to provoke by insult posting that I didn't
know "the difference between input and output streams"...pure
TROLLERY that didn't HELP ANYBODY, NEWBIE OR NOT,
AND SOMETHING HE KNEW FOR A FACT WAS A LIE.

Richard Heathfield said:
CBFalconer said:



According to the Standard, the behaviour is undefined. Implementations are
free to make fflush(stdin) do anything they like, *including* what many of
their users expect it to do - and some implementations do precisely that.
(In fact, that's the problem.)


Agreed, but that doesn't mean it won't work. (Neither does it mean it
/will/ work, of course.)

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999

Thanks for the confirmation that you're just a worthless troll...
 
F

Flash Gordon

Bill Reid wrote, On 20/03/08 01:57:
Oh God, what did I say about this NEVER ends...

Flash Gordon said:
Bill Reid wrote, On 12/03/08 14:49:
Bill Reid wrote, On 12/03/08 01:54:
Bill Reid wrote:
Bill Reid wrote:
[...]
"Is it possible to write a totally 'portable'
function that will consume ALL the characters left in the standard
input
regardless of platform?"
Yes, barring I/O errors that disrupt the flow of control.

#include <stdio.h>
void eat_stdin(void) {
for (;;getchar());
}
Exactly, some code to that effect, I thought everybody knew this...so
why is it news to all the other posters to this thread but you and me?
If you know how to do the job correctly in one line then you have even
less excuse for posting a non-portable solution.
You trolls really need to coordinate your efforts better...you've got
about three different and mutually exclusive threads of insane troll
logic going here...the above is the "joke troll", and another troll is
now actually ENDORSING fflush(stdin)!!!
Your inability to understand the issues people point out does not make
the logic insane. Your claiming that everyone that disagrees with you is
a troll does not help your arguments.

Where have I displayed an "inability to understand the issues"?

Each time you have denied that they are real issues.
I have undeniably displayed GREAT understanding of the "issues".
To aver otherwise is a TROLL, period. To claim that somehow I
am destroying the budding career of a nascent programmer by
posting functional "C" code is also a TROLL, PERIOD.

Ah, but it is only functional on your specific implementation, not
functional in general. Another example of you demonstrating a failure to
understand the issues.
You can "disagree" with that, but you'd be wrong...

And an example of your arrogance.
You all address points at RANDOM for the apparent sole purpose
of TROLLING.

No, different people thing about and raise different issues. That is
human nature.
I KNOW they don't have valid "reasons". I've covered this TIME
and TIME again.

Thus showing again that you do not understand the issues.
Something that MIGHT happen on another system,
or somebody deliberately trying to terminate a program stupidly,
are NOT "REASONS" to insult a person and claim that innocent
newbies are being misled. In fact, the TROLLS here are the ones
that are confusing and misleading the "newbies"...

Not all newbies are developing for the same platform as you. We have
seen people doing courses using Linux (where your code does not work)
and old versions of Turbo C (where you have probably not tested your
solution).
if(yn_input[string_size-1]!='\n') {

fflush(stdin);
goto ReTry;
}

Which is an effective work-alike to:

if(yn_input[string_size-1]!='\n') {

while(getchar()!='\n') ;
goto ReTry;
}

Will that work, or is it too "platform-specific"?
Well, the second case definitely won't flush everything from the input
buffers for standard input on some systems (the buffers, which include
OS buffers, could have more than one line in it on some systems under
some conditions), but it is more likely to meet the real requirements
rather than the stated objective of flushing the buffer.
Well, semantics again, a real problem that I'm willing to let slide,
I wasn't talking about flushing a "buffer", just getting rid of any
unconsumed
characters input by the user.
The buffers I mentioned are where that input is stored. So substitute
"unconsumed characters input by the user" for "buffers" and it still
applies.

OK, then I'll just use fflush(stdin) because that has a shot of
working to YOUR specification on MY system, your anal-retentive
highness.

It was *your* stated requirement, not mine.
Got a problem with THAT? Oh yeah, I forgot...you're
a TROLL, so of course you've got a problem with that, THE ONE
THING ABOUT TROLLS IS YOU CAN NEVER WIN, AND I
CAN'T WIN CAN I?!!?!!

I have no problem with you using anything you want in your own
unpublished code. If you publish code here using fflush(stdin) with it
marked as non-portable and what you expect it to do I also am unlikely
to comment on it.
Been over this time and time again, but I will admit that because
of certain college training and some of my actual money-making work
I have a greatly more educated approach as to what constitutes a "problem"
that will occur frequently enough to worry about...

Yet you show a lack of knowledge about the problems of real world
computing beyond your own system.
maybe if you went
back to school and got an actual education, at least you wouldn't have
all this free time to TROLL the Internet...

I have time to use Usenet because I am have demonstrated to my bosses
that I am knowledgeable, a fast learner, and able to do the jobs well
enough and fast enough.
YAY ME!!! Now my only question is:

WHY DOES THAT BUG YOU SO FRIGGIN' MUCH??!!!?!!

Seriously, what's your problem?

You posting non-portable code for others to use and insisting that is
not clearly marked as such for the use of people who will not have the
experience to recognise it as such.
That's not what I said, the code to eat all the characters to a newline
took me about as long to type it, maybe a three seconds, and I would
definitely consider anybody who took five minutes to be a drolling retard
that probably WOULD type CNTRL-z when prompted to press 'y' or

Well, up above you said it took you two hours the first time. Where as
it took me less than 5 minutes (I don't bother keeping track of how long
simple jobs take so I don't know how much less).
'n'...but I've already admitted you guys aren't SMART ENOUGH to
use my brilliant software...

Ah, so people well paid for there experience knowledge and skills are
not smart enough.
Tell the truth, you've never written a functioning line of code in your
worthless life.

That would explain why there are aircraft flying around with a lot of my
code in it, why my code has helped win large bids (including against
companies like Boeing), why my code is being used by large companies to
interface different systems etc.
I mean, how could you, boss walks in, gives you the
simplest assignment possible, months later you're still arguing about
buffers on Ukrainian abacii and the effect of the "I LOVE YOU" virus
on your program and on and on and on and on...

I don't, I just do it correctly because my boss expects it to be done
correctly. Fortunately my boss does not insist on non-portable and/or
incorrect solutions being used or on ignoring error conditions. In fact,
the putting in of traps for things people consider impossible has on a
number of occasions saved a lot of work and made us look good to the
customer, because those traps were triggered and the software either
handled it correctly or correctly reported what the problem was.
REAL programmers use two digits for year dates in 1996 and
are DONE with it (but waiting for the phone to ring to fix their crap
in 1999).

I kept being asked about whether my software was Y2K compliant, the
answer was yes. However, I did have to tell them that the OS on one of
the systems would have problems in 2028. So I would say that real
programmers in 1996 were designing and implementing their systems so
that they would correctly handle Y2K, which for some systems can be done
with a 2 digit year (well, some of my software would fail if you put it
in a time machine and took it back to some time in the 1800's, but that
is unlikely enough not to worry about). People who were doing what you
describe after being made aware of the problem were people who should
not be working in IT.
I NEVER ARGUED ABOUT IT, YOU LYING INSANE TROLL!!! I SAID
I PERSONALLY DIDN'T CARE FOR MY PURPOSES!!! I KNOW YOU'RE
STUPID, BUT YOU CAN'T BE THAT DUMB NOT TO BE ABLE TO TELL
THE DIFFERENCE!!!

When it was pointed out that fflush(stdin) is non-portable you claimed
that it works and the portability problem 'ONLY EXISTS ON THIS NEWSGROUP
AND NOT IN "REAL LIFE"...'. Making claims like that in a maner generally
considered to be the equivalent of arguing certainly seems like arguing
to me.

You still fail to understand that posting code here in answer to a
question is *not* posting code for your limited purposes. At least, not
unless your purpose is to provide bad advice.

You actually stated:
| For the "console" application, the code performs all possible error
| checking for fat-fingered idiotic input, and keeps prompting the user
| until it gets either 'y' or 'n', which it then returns to the calling
| function

This is clearly incorrect since you did not check for EOF which *can* be
generated in various ways.
They could have just pointed them out and be done with it when I
said I didn't care about that stuff, since NOTHING that ANY of you
TROLLS have brought up actually constitutes any kind of a REAL
"problem" with the code.

Only for your very limited usage. However for your limited usage it does
not have to be posted here.
YES, YOU INSANE TROLL, EXACTLY, FORCING YOUR INSANO
UNACHEIVABLE "REQUIREMENTS" ON ME IN AN INSULTING AND
MISLEADING FASHION IS A TROLL, PURE AND SIMPLE!!! I GLAD
YOU'RE LEARNING!!!

Well, as you don't want to address the requirements of anyone else why
post an answer? After all, to sensibly help someone with their code it
is *their* requirements not yours that matter.
SURE IT SHOULD, YOU CREEP!!!


So are saying there aren't such things as insane trolls on Usenet?

No, you are here. You are also failing to address the point above that
failure *do* happen in real life on stdin.
I say they exist with great regularity in this group RIGHT HERE IN
THIS THREAD!!! I have simple and objective tests for trolling behavior,
and applied them to this "real life" situation, sorry...

No, what you are doing is applying arrogance and trolling behaviour.
Possibly you are doing this to try and hide the fact that your program
was erroneous (the OP did not state the platform, so the only correct
answer would be one that was not platform dependant in undocumented ways).
JUST LIKE INSANE TROLLS!!!

I'm OK with my much simpler version; standard input EOF just doesn't
occur that much in MY "real life", but if it starts to crop up, I'll be the
first
to make that major change...

You still don't know if it occurs in the OPs real life. Some people do
learn programming on remote systems. Some people test interactive code
by piping in files to stdin (it makes it easy to replicate the test).
The OP could be tripped up by either quite easily. Some instructors also
read the code to see if it has been properly written, and the OP could
fall foul of that as well. So your code was certainly not suitable for
the OP to use.
THAT'S NOT WHAT I SAID!!!

No, a problem was pointed out and you claimed it was trolling, just as
you seem to claim every problem pointed out was a troll.
Great troll though, because for a second you kinda fished me in that
you understood what trolling behavior was...but I shoulda known better...


Oh, now it's "messy"...what's next, you gonna call it "icky"?

It would be appropriate. So would a number of other terms.
I'm sorry I called you "anal-retentive" because that is an insult
to stool-retainers everywhere...

So now you are insulting people for pointing out bad style in your code,
style likely to get points knocked off if it is handed in as homework.
Sure it does troll. Sure it does...

Yes, for a start instructors knock off marks for bad coding style. Then
there are the reviews at work that would reject it. Then there is the
maintenance programmer who has to try and decipher needlessly complex code.
Well, troll, you'd best be policing all the "messy" code posted
here with those "problem" gotos...I expect to see a lengthy post
every time you see a goto here explaining exactly why they
are so "messy" and cause "problems"...

Now you are putting words in my mouth as well. I stated that it was the
use of goto to implement a retry use, not the use of goto in all situations.
For my purposes, that's not a drawback, that's a feature...

Ah, so you want code that hangs instead of doing anything useful. Or,
more likely, you failed to see the deliberate problem in the code and
are trying to pretend that you did.
Oh, a little from column "A", a little from column "B"...

Well, at least we have an admission you are trolling.
How about the fat guy in "Jurassic Park"?

Now actually address the point rather than making obviously stupid
remarks. Unless you really are so stupid you think that Jurassic Park
was a documentary.
So programmers don't like doughnuts? Hell, I myself like chocolate
icing and the granulated sugar ones (but rarely eat them to try to avoid
looking like the fat guy in "Jurassic Park"), what's the big deal? Man
you take offense easily...

You being needlessly insulting probably in an attempt to draw attention
away from the glaring problems in code you posted.

I think you have demonstrated clearly to any newbie who stumbles across
this thread that you don't understand the issues, don't know how to
write code that would be acceptable on a programming course or in most
companies, and can't take any criticism of your work.

Thread-Plonk
 
J

jacob navia

Do not get upset Bill.

Just read the thread I started with

"BUNCH OF PEDANTS"!

These guys are just like predators.

They sense when somebody is not a member of their club and
will start laughing and making fun of him forever.
 
R

Richard Heathfield

jacob navia said:
They sense when somebody is not a member of their club
TINC.

and will start laughing and making fun of him forever.

If you are sometimes mocked, it is not because you're not a member of some
non-existent club (TINC, remember), but because of your apparent
unwillingness to learn.
 
J

jacob navia

Richard said:
jacob navia said:


If you are sometimes mocked, it is not because you're not a member of some
non-existent club (TINC, remember), but because of your apparent
unwillingness to learn.

To "learn" WHAT ?

It doesn't even come to your spirit that we have different
viewpoints?

You do not want to understand that after working for
something like 10 years to implement a C99 compliant compiler
I do not want to "learn" that C99 is "dead" as you say?

I do not think so.

Neither do I share your pedantic attitude about the
language where there absolutely
no space for improvements of any kind.

No, I do not want to learn that "turboc" is the best compiler
around. I think this language has a future, can evolve, like
any other language. I do not want to go to 1988 when turboc
ruled the world.

You see other people's different viewpoints as thought that
people are unable to "learn". What an arrogance!

No, I do not want to *teach* you anything. Yours is not
an unwillingness to "learn". You have just another viewpoint,
another opinion about things than me. That's all.
 
R

Richard Heathfield

jacob navia said:
To "learn" WHAT ?

In your case, practically everything.
It doesn't even come to your spirit that we have different
viewpoints?

Oh yes, of course it does. But whilst cultural diversity is a marvellous
thing, there is a *reason* why Usenet is divided into topic areas. If you
could at least learn /that/ lesson, that would be a step forward. But
after all these years, I'm not about to risk holding my breath.
You do not want to understand that after working for
something like 10 years to implement a C99 compliant compiler
I do not want to "learn" that C99 is "dead" as you say?

Neither do I share your pedantic attitude about the
language where there absolutely
no space for improvements of any kind.

Oh, but I think there *is* a certain amount of room for improvement. That's
one of the things that comp.std.c is for - discussing changes to the
language definition.
No, I do not want to learn that "turboc" is the best compiler
around.

I think this language has a future, can evolve, like
any other language.

So do I. And if I identify an area where C can improve, I'll raise the
matter in comp.std.c.
I do not want to go to 1988 when turboc ruled the world.

I could sure use being twenty years younger, but no, I don't want to turn
the clock back either. Nevertheless, the language that was standardised in
1989 is effectively the same language we use today, because C99 was such a
disaster in implementation terms.
You see other people's different viewpoints as thought that
people are unable to "learn". What an arrogance!

As happens so often, you have misinterpreted me - and yet you claim to be
able to understand my thoughts and motives. What foolishness! You have
also failed to notice that lots of people here have different viewpoints
to me, and yet I manage to communicate with them perfectly well - Keith
Thompson, Ben Pfaff, Dann Corbit, Martin Ambuhl, and so on, all have very
different opinions to me on some aspects of C programming, but I don't
consider them unable to learn. For example, they know what C is, and they
understand the distinction between the language proper and the language as
implemented on a particular platform.
No, I do not want to *teach* you anything.

On the other hand, I'd love to learn from you, just as I love to learn from
anyone. But I'm not counting on it ever happening.
Yours is not
an unwillingness to "learn". You have just another viewpoint,
another opinion about things than me. That's all.

Postmodernism has a lot to answer for.
 
R

Richard Heathfield

jacob navia said:

You are part of that pile of shit

When your standard debating technique is to insult your opponent, it must
be difficult for anyone to take you seriously.

Has it ever occurred to you to consider that the people you attack so
loudly might just know what they're talking about, and might just have a
reasonable point?
 
R

Richard

Eric Sosman said:
Quod erat demonstrandum.

You really have become another one of the pedantic arseholes who ruin
this group.

Why did you snip Jacob's pertinent points?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top