Re: C++ Bounds Checking
- From: "Wade Ward" <invalid@xxxxxxxxxxxx>
- Date: Sat, 7 Jul 2007 16:05:02 -0400
"James Giles" <jamesgiles@xxxxxxxxxxxxxxxx> wrote in message
news:UMRji.291634$p47.163187@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
glen herrmannsfeldt wrote:I'm not sure what you mean here. C's leading Limey, Richard Heathfield,
...
Related to the question about why people are more worried about
program speed now than they were 30 or 40 years ago...
I haven't found that to be a universal feeling. More common is
a kind of "penny wise - pound foolish" attitude where they use
really costly coding styles but also worry about minutia. In
terms of code size and/or cpu cycles for a given job programs
are certainly bigger and slower than in years past.
...
As for gets(), I don't find fgets() that much harder to use,
but I might see using gets() for a quick run-once program, such
as to test a compiler feature or other quick test. Even then,
fgets() isn't that hard to use.
Yes alternatives are easy to use and not noticably slower (it's
I/O! how could any simple test be significant compared to an I/O
system call?). My point was that gets() is still in the C standard
and still taught in schools. What lesson can students be expected
to learn from that? Surely they'll conclude that it's a reasonable
coding style.
considers gets() harmful, c.f. _C Unleashed_, p. 263. If I were going to
get() something, I'd use Cbfalconer's ggets(), which he has at his site. I
think it's ironic that it took Heathfield to solve the memory problems
involved therewith, and that's just this last year!
--
Wade Ward
.
- Follow-Ups:
- Re: C++ Bounds Checking
- From: James Giles
- Re: C++ Bounds Checking
- References:
- Re: C++ Bounds Checking
- From: Gordon Sande
- Re: C++ Bounds Checking
- From: blmblm
- Re: C++ Bounds Checking
- From: James Giles
- Re: C++ Bounds Checking
- From: blmblm
- Re: C++ Bounds Checking
- From: James Giles
- Re: C++ Bounds Checking
- From: glen herrmannsfeldt
- Re: C++ Bounds Checking
- From: James Giles
- Re: C++ Bounds Checking
- Prev by Date: Re: is this syntax legal (transfer()) ?
- Next by Date: Re: C++ Bounds Checking
- Previous by thread: Re: C++ Bounds Checking
- Next by thread: Re: C++ Bounds Checking
- Index(es):
Relevant Pages
|
|