Post by Bill CunninghamI just wondered how many people like me think removing gets() from the
standard is a mistake.
Many others have spoken already, but my two cents are that they should
have done it long ago. It's a simple enough function that anyone truly
wanting it could roll their own, and do a better job in the process. In
fact, I'd make a bar bet that just about every serious C programmer with
a lot of years of experience with C probably has already replaced it in
their own personal 'kitchen sink' library that they carry around with
them. Probably along with strtok() and pretty much everything that has
a ludicrous _s() suffix in the standard lib today.
Post by Bill CunninghamI think so because C has some much heritage left over from so many
different standards; such as c89 C99 C11.
That's because they didn't *replace* C with another language every
time they put out another overpriced and underwonderful standard
document. That said, although there was much to like and little that
could not be accomplished with original K&R C, some things did get
tweaked. Occasionally those tweaks were even valuable.
Post by Bill CunninghamIt is well know about gets() problems just don't use it.
I'm not quite sure I am parsing the intent behind this sentence
correctly. If you meant to write that in order to avoid gets()
problems you should just not use it, then I can agree with the
logic of that. Unfortunately, in practice, that is not what happens.
CS professors all over the globe apparently love to use gets() even
today as a quick and dirty way to introduce young kids to C for
the first time, and usually without any warning(s). You see it
come up over and over again in places like comp.lang.c and various
IRC channels, usually around the start of a new term.
Post by Bill CunninghamC++ style comments were added the /* */ comment delimiters
weren't removed.
And there is no reason to remove them. There aren't in any way
dangerous, and I'll make a little confession, I still use them
instead of the C++ flavor.
Post by Bill Cunninghamsterror ad errno was added. perror wasn't removed.
Again, perror isn't inherently broken, as gets clearly has been
all along.
Post by Bill CunninghamVersatility and using various mixes and styles is part of C's appeal. I
like C89 and C99 myself. C11 I don't even bother with.
Well, you can certainly make a valid case that some, perhaps even many
of the things added in various versions of the standard aren't needed or
even useful for many programs. I'm not sure how that makes any kind of
argument in favor of keeping gets around though.
Putting it somewhat crudely, I was actually surprised to learn that the
committee had grown a pair and finally removed it. Then that feeling
was somewhat lessened when I saw gets_s. Then somewhat improved when
I realized that it was optional, so nobody will ever use it, which
perhaps was the real intent all along :-)
--
Randy Howard
(replace the obvious text in the obvious way if you wish to contact me
directly)