F
Flash Gordon
Hallvard B Furuseth wrote, On 03/05/07 12:54:
The problem with gets is bad instructors and the students taught by them
in my opinion.
No, they won't. However, it will not be removed from libraries until
*after* it is removed from the standard, and it will not be removed from
the standard until *after* it has been deprecated. So it being
deprecated is a necessary first step to getting rid of it, and getting
rid of it will one day stop bad instructors from teaching students to
use it.
Well, that is my opinion.
I also think that it was stupid of the ANSI and ISO committees not to
deprecate it in the first standard. Other things which at the time were
common were deprecated in ANSI C89, so why not gets? However, that is in
the past.
Note, I am not saying the people on the committees are stupid, merely
that something they did (or did not do) was stupid, and even the best
people sometimes do stupid things.
I get it. I get it. What I don't get is why it's such a big deal
whether or not it gets removed from the standard. You don't need these
heavy padlocks. All you need is to not use it if you want the program
to stay in control of itself. And most of this talk about checking to
see if gets() is used is just nonsense. Sure, if someone hands you a
program and you happen to notice it uses gets(), that's reason to get
mighty suspicious. But quite likely, reading a bit of that person's
code in the program will also give you a reason to get mighty suspicious
- whether or not it is in a program which where he happens to use
gets().
The problem with gets is bad instructors and the students taught by them
in my opinion.
If we _are_ talking about helping naive users, then like I said what I'd
like to see is the addition of a safe and equally convenient function.
By all means remove gets() from the standard too, but that isn't going
to remove it from existing libraries anytime soon. So programs won't
suddenly turn safe (in that particular regared) because of it.
No, they won't. However, it will not be removed from libraries until
*after* it is removed from the standard, and it will not be removed from
the standard until *after* it has been deprecated. So it being
deprecated is a necessary first step to getting rid of it, and getting
rid of it will one day stop bad instructors from teaching students to
use it.
Well, that is my opinion.
I also think that it was stupid of the ANSI and ISO committees not to
deprecate it in the first standard. Other things which at the time were
common were deprecated in ANSI C89, so why not gets? However, that is in
the past.
Note, I am not saying the people on the committees are stupid, merely
that something they did (or did not do) was stupid, and even the best
people sometimes do stupid things.