Thread: To fflush, or Not to fflush...

  1. #16
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >I get the impression you are a moderator here.
    No, just a concerned citizen.

    >then it should be stated in the rules or guidelines.
    That's just it, we don't force you to stick to the standard, but it is encouraged unless there is a good reason to stray. For example, if someone asks how to clear the screen in Linux, we'll go through the whole row about whether clearing the screen is necessary, the disadvantages, and that there's no portable way to do it. However, despite these warnings, we will still provide a non-portable solution because we have enough information to do so. Putting a global ban on all things non-standard is just plain dumb, as you clearly understand.

    >It seems every time anyone, including me, mentions something
    >that is not standard C on this board, they get flamed for it, often by you.
    Often by me? Should I assume that you've been lurking for several years and keeping count? Seriously, nobody is flamed for talking about non-standard features. They may be corrected in such a way that could be construed as flaming, but the only real flames come when someone (such as yourself) encourages a feature that works for them, but breaks in a gloriously hideous manner just about everywhere else (such as fflush ( stdin )).

    >you need to widen your perspective and BACK OFF
    I could say the same about you.

    >If you limit yourself to standard C only, your programs are not going to be very interesting (or marketable).
    If you're learning C, then the worst thing you could do is learn an implementation rather than the language proper. And as for your general statement about standard C being useless, I write programs every day that conform to the standard that are terribly interesting, and I make a good living doing it.
    My best code is written with the delete key.

  2. #17
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    Quote Originally Posted by Prelude
    And as for your general statement about standard C being useless, I write programs every day that conform to the standard that are terribly interesting, and I make a good living doing it.
    You have no idea how often I curse about this. Every time we start working with interesting data structures, I think "Damn...wish we could have hired Prelude."
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  3. #18
    Registered User
    Join Date
    Sep 2004
    Posts
    44
    Prelude,

    I was not encouraging the use of fflush(stdin).

    I stand by what I said.

  4. #19
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    n7yap,

    Why do you think you are getting flamed? All she was doing was explaining that why it is not the best idea to encourage someone who is learning to use non standard code.

    When I am coding I want to know what my code is going to do not what it could maybe do. So relax and listen with the intention to learn something instead of listening with a huge chip on your shoulder to some really good advice.
    Woop?

  5. #20
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    Quote Originally Posted by kermit
    Although even when using fgets() there will be characters left in the buffer if the size of the storage is less than the amount of characters entered by the user.
    Yes, and fgets provides you with methods of figuring out if you have read all of the data or not.

  6. #21
    Banned
    Join Date
    Jun 2005
    Posts
    594
    dont mistake me though, i was flaming you.
    you leave my woman (prelude) alone.

  7. #22
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    The board rules don't say anything about the standard, but Prelude ( as always ) is right: In the majority of posts we don't know what compiler is used and even if we know, it's better to suggest a standard compliant way so people who are interested and find this thread through googling later on ( looking around here I get the impression that googling is some kind of black magical art that only a few chosen can use, but that's not the point ) ... err... anyway, the reply should help all people, not just the specific poster, so if it can be reached by teaching the standard compliant way to everyone, that would be perfect.

    There are more than enough tasks that require non-standard methods later on, so we should keep to it as long as possible
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  8. #23
    Registered User
    Join Date
    Sep 2004
    Posts
    44
    nvoigt,

    Thanks for the reply. I understand.

    It's not the first time Prelude has gotten on my case for posting about something that is not standard C, so it kind of struck a nerve.

  9. #24
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    It's rather amusing that you with your C99 avatar apparently so frequently post the use of non-standard functions.


    Quzah.
    Hope is the first step on the road to disappointment.

  10. #25
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    Quote Originally Posted by n7yap
    It's not the first time Prelude has gotten on my case for posting about something that is not standard C
    What? You didn't learn the first time?
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  11. #26
    Registered User
    Join Date
    Sep 2004
    Posts
    44
    quzah,

    I fully support C standards, and I think C99 is great. But I also don't limit myself to standard C only.

    I can see the point that when you are teaching someone C, sticking to the standards is a very good idea.

    I came here not necesarily to learn and not necesarily to teach, but for interesting discussion about C. I think I'm in the wrong place.

  12. #27
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204
    Quote Originally Posted by ILoveVectors
    dont mistake me though, i was flaming you.
    you leave my woman (prelude) alone.
    Woah theres a woman here

  13. #28
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by n7yap
    I came here not necesarily to learn and not necesarily to teach, but for interesting discussion about C. I think I'm in the wrong place.
    No, you just got in a huff for no reason other than the fact that people told you your code wasn't gold-plated. You post code for public consumption, they're going to tell you what they think of it. If you don't like people commenting on your posts, don't post. If you do want to post, don't be so thin-skinned. Personally I don't care if you post or not.


    Quzah.
    Hope is the first step on the road to disappointment.

  14. #29
    Registered User
    Join Date
    Sep 2004
    Posts
    44
    quzah,

    I didn't post any code.

  15. #30
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >It's not the first time Prelude has gotten on my case for posting about
    >something that is not standard C, so it kind of struck a nerve.
    Well, seeing as how I've only challenged you two times aside from this thread, one of those times you asked us to shred your code and the other was concerning keeping the input buffer tidy, I don't see how I've ever gotten on your case for something non-standard before now. Perhaps you simply misinterpreted my comments in the past as some sort of insult. If that's the case then I appologize. I wouldn't want you to be insulted unless I'm actually insulting you.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fflush and fgetc question
    By spank in forum Linux Programming
    Replies: 3
    Last Post: 05-24-2007, 05:39 AM
  2. When and where to use fflush (stdout)?
    By Micko in forum C Programming
    Replies: 8
    Last Post: 02-18-2005, 11:58 AM
  3. Problems with input and fflush
    By edugarcia in forum Linux Programming
    Replies: 1
    Last Post: 11-24-2004, 01:52 PM
  4. Why is fflush needed here?
    By Ariod in forum C Programming
    Replies: 2
    Last Post: 11-11-2004, 07:20 PM
  5. everyone's favorite...fflush
    By BungleSpice in forum C Programming
    Replies: 8
    Last Post: 03-12-2004, 11:53 AM