K
Kenny McCormack
Richard said:You really have become another one of the pedantic arseholes who ruin
this group.
He has always been.
Why did you snip Jacob's pertinent points?
See above.
Richard said:You really have become another one of the pedantic arseholes who ruin
this group.
Why did you snip Jacob's pertinent points?
jacob navia said:
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?
Richard Heathfield said:<shrug> That's merely my opinion. C99 is obviously topical here.
So do I. And if I identify an area where C can improve, I'll raise the
matter in comp.std.c.
The C language, for one. Manners, for two.
This is certainly true. However, not everyone agrees. In fact, even if
you grant all the silly assumptions and rules that are necessary in
order to post here, the fact remains that if you post something that
uses a C99 feature (e.g., VLAs) and fail to make copious assertions to
the effect that this is a "C99 only feature" and "not C89, etc, etc",
some twit will nitpick your post to that effect.
Even though C99 *is* the current standard. This fits in very well with
my general observation about religiosity in this NG - the obsession with
outdated texts.
...
You need to go back and check your catechism. csc is for discussion of
the standards document(s) as written - i.e., things like "What does the
word shall on page 73, paragraph 7, sentence 2, mean?".
Eric Sosman said:My solution to the problem you posed is as correct as
Smullyan's recipe -- and equally useful. It solves the problem
you stated, while demonstrating that solving it is useless.
Didn't you notice that little drawback?
"Be careful what you ask for" may be the most important
maxim of the programmer's trade.
Flash Gordon said:Ever heard that stereotypes are generally both insulting and wrong?
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.
Bill Reid said:Thanks for the confirmation that you're just a worthless troll...
Flash Gordon said: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.
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.
And an example of your arrogance.
No, different people thing about and raise different issues. That is
human nature.
Thus showing again that you do not understand the issues.
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.
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.
Yet you show a lack of knowledge about the problems of real world
computing beyond your own system.
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.
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.
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).
Ah, so people well paid for there experience knowledge and skills are
not smart enough.
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 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.
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.
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.
Only for your very limited usage. However for your limited usage it does
not have to be posted here.
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.
No, you are here.
You are also failing to address the point above that
failure *do* happen in real life on stdin.
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).
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.
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.
It would be appropriate. So would a number of other terms.
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.
Yes, for a start instructors knock off marks for bad coding style.
Then
there are the reviews at work that would reject it.
code.Then there is the
maintenance programmer who has to try and decipher needlessly complex
situations.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
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.
Well, at least we have an admission you are trolling.
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.
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
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.