Re: [Lit.] Buffer overruns

From: Douglas A. Gwyn (DAGwyn_at_null.net)
Date: 12/28/04


Date: Mon, 27 Dec 2004 23:33:24 -0600

Mok-Kong Shen wrote:
> But the result of the statement is 'undefined' in that situation.
> So, if the condition a[i]==i is not checked, then this could
> lead to something wrong. Are you suggesting that it is the
> user's responsibility to explicitly check that to avoid such
> undefined cases?

It is certainly the programmer's responsibility to avoid
triggering instances of undefined behavior. If you're
unwilling to learn the modest amount required to fulfill
such a responsibility, it would be best if you refrained
from programming.

> Using pointers in the C way is inherently unsafe.

Wrong. A very large number of programmers use them
quite safely.

> That's why I called it a 'pitfall'.

Of course it's a pitfall. Reasonable people *avoid*
pitfalls. One doesn't have to shun an entire PL
just because it requires care in certain cases.
In fact all PLs require some degree of care if
correct results are to be obtained.

> Perhaps it is also the case that no skilled programmer is
> a substitute for a PL designed for safety of programming and
> void of pitfalls.

Wrong again. The history of PL development is full
of examples where an attempt was made at automating
some property like safety, without the goal actually
being obtained. No compiler can read your mind (or
better, the minds of the end users) to determine what
the actual intent of the instructions is. They have
to go by what the programmer specifies, which if it
is incorrect will produce incorrect results.

>> I think average users will struggle with C. C programmers, however,
>> should not. It's a great pity when they don't live up to expectations.
> You are 'defining' the problems away.

No, he isn't. He's saying that it is reasonable to
require craftsmen to be masters of their tools.
You on the other hand seem to think that tools must
be built (somehow) to guarantee that unskilled and
undisciplined amateurs will always obtain quality
results. In any other discipline the absurdity of
that notion would be evident..

There is a difference between production and
consumption, and between the behaviors of the people
acting in those roles. In order to provide consumers
with better, eay-to-use products, producers usually
need to do some hard work (which the consumer doesn't
see and often is unaware of).



Relevant Pages

  • Re: [Lit.] Buffer overruns
    ... > from programming. ... >> void of pitfalls. ... > consumption, and between the behaviors of the people ... kinds of standardization, not only in PLs) to be trivial. ...
    (sci.crypt)
  • ABC Family renews "Secret Life," orders comedy "Baby Daddy," docuseries "Nannies"
    ... ANNOUNCES THE FIRST PORTION OF ITS NEW ORIGINAL PROGRAMMING SLATE ... NETWORK ORDERS THE COMEDY SERIES ?BABY ... GROUND BREAKING ORIGINAL SERIES ?THE Secret Life of the American ... The movie begins production ...
    (rec.arts.tv)
  • WCF Service Internet Scenario on localhost, staging, production en
    ... I just ready through Programming WCF Services by Juval Lowy, ... production with these WCF Services as part of an ASP.NET 3.5 website. ... are on production, if I have one endpoint for each of the three environments, ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: "Lites out" machining--whats amenable, whats not?
    ... So ahm doin my li'l shit prototypes, 10-15 fadal tools, and I fantasize about the day I'm finally bustin out production. ... Positioning multiple parts is important for chip flushing, allow no way for chips to build up and create problems for your tools. ... Make sure the coolant is topped off before you lock the leave. ... Trust your programmer, if he stands at the cnc doing manual edits on anything other than setup positioning, that guy is probably NOT a lights out programming candidate. ...
    (alt.machines.cnc)
  • Re: Thoughts on teaching OO concepts to COBOL programmers
    ... COBOL to any OO style of programming. ... What were your pitfalls, what was ... One pitfall is they will find ways to turn OO design back into Cobol concepts. ...
    (comp.lang.cobol)