View Poll Results: Do programmers know how to use scanf?

Voters
10. You may not vote on this poll
  • Yes

    5 50.00%
  • No

    5 50.00%

Thread: scanf

  1. #1
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005

    scanf

    I'd venture a guess that over 95% of the people who use scanf don't actually know how to use it.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  2. #2
    verbose cat
    Join Date
    Jun 2003
    Posts
    209
    I've used it many times, always just mirror a printf() when I use it, and I'm probably missing something. I tend to prefer c++ and std::cin, but that's mainly because I'm lazy.
    abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments "

  3. #3
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    I don't use it because I don't know how to use it correctly...
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  4. #4
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    I'm wondering if this is the place to ask that question. Or if there is any place where you could ask this question at all and get unbiased and fair results.

  5. #5
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Well since your question didn't directly indicate the person filling out the poll, I said yes since I'd expect programmers (professional in particular) to know how to use it. I usually use the variants to read data in from a string since I rarely read data from the keyboard using methods that require a carriage return.

  6. #6
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    I voted yes, but I've a feeling that there's some kind of twist in what you asked. I know how to basically use it, I would have to look up some of the letters to follow the % signs for different types of variables, but on face value, I believe I do know how to use it.

    Why do you think ~5% of people know how to use it?

  7. #7
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Twomers:
    > I voted yes, but I've a feeling that there's some kind of twist in what you asked. [...]
    > I believe I do know how to use it.
    Positive thinking!

    Dave is generally not a rude person I think, so I doubt he's insulting anyone. If I had to guess though, just recently, someone blindly recommended use of scanf for apparently no reason. And Dave was just so appalled...

  8. #8
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >I'd venture a guess that over 95% of the people who use scanf don't actually know how to use it.
    That's pretty pessimistic. I'd say that most people who know C also know scanf well enough to use it successfully for basic things. When you get into solid, robust usage and advanced features like scansets and read counts, your guess is probably more accurate. I voted no because I consider the ability to safely use scanf important, and I see it very rarely.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. scanf() consideres useless
    By Snafuist in forum C Programming
    Replies: 15
    Last Post: 02-18-2009, 08:35 AM
  2. Help with a basic scanf procedure.
    By killpoppop in forum C Programming
    Replies: 9
    Last Post: 11-03-2008, 04:39 PM
  3. Replies: 2
    Last Post: 02-20-2005, 01:48 PM
  4. Scanf and integer...
    By penny in forum C Programming
    Replies: 3
    Last Post: 04-24-2003, 06:36 AM
  5. scanf - data is "put back" - screws up next scanf
    By voltson in forum C Programming
    Replies: 10
    Last Post: 10-14-2002, 04:34 AM