Re: Increasing efficiency in C
From: Nick Landsberg (hukolau_at_NOSPAM.att.net)
Date: 03/05/04
- Next message: Leor Zolman: "Re: Reset a string?"
- Previous message: spike: "Reset a string?"
- In reply to: Mike Wahler: "Re: Increasing efficiency in C"
- Next in thread: jacob navia: "Re: Increasing efficiency in C"
- Reply: jacob navia: "Re: Increasing efficiency in C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 05 Mar 2004 20:50:20 GMT
Mike Wahler wrote:
> "jacob navia" <jacob@jacob.remcomp.fr> wrote in message
> news:c2ajah$t8a$1@news-reader3.wanadoo.fr...
>
>>"Mike Wahler" <mkwahler@mkwahler.net> a écrit dans le message de
>>news:9G32c.22867$aT1.20587@newsread1.news.pas.earthlink.net...
>>
>>>Back [almost?] to topic: If I couldn't control my memory handling
>>>and pointers, I wouldn't use C.
>>
>>You keep control of everything.
>
>
> That's right. That's why I like C. But with such
> control comes responsibility. I if lose control,
> it's my own fault.
>
>
>>But the system should
>>have an automatic.
>
>
[ Much Snipped ]
Another 2 cents US into the discussion.
The "C" language is used for a multitued of
applications. For some of these applications,
failure is benign, for some not.
Jacob, in your proposal what should be the
default behavior if an array bounds is
exceeded? Abort the program?
If it is on a PC web browser, that is perfectly
acceptable behaviour. (I think).
If it is in a program running a heart-lung machine,
I doubt that it is.
If a programmer were to use current C and his/her
program caused the heart-lung machine to go haywire,
that programmer ought to be shot (overstatement).
If, using your proposal, and the default was to abort
the program, that programmer should still be shot!
If the default is not to abort the program, what then?
Continue as we do today? That's a no-op.
If the proposal is to override the behaviour and take
intelligent action when that happens, then the
selfsame competent programmers who today take pains
to make sure they do not exceed array bounds would
be the ONLY ones who took the same pains to override
default behaviour. For the incompetent ones, the program
would abort. (Possibly a little sooner than it does now,
I'll grant that. Maybe training them to be more
competent would be a better answer?) As Dan Pop, I believe,
said, "C is structured assembler." To use it properly
you have to develop a certain expertise. This expertise
involves checking all possible error conditions. If you
don't do that, you should not be programming in C.
See .sig line.
You are trying to make it foolproof. :)
-- Ñ "It is impossible to make anything foolproof because fools are so ingenious" - A. Bloch
- Next message: Leor Zolman: "Re: Reset a string?"
- Previous message: spike: "Reset a string?"
- In reply to: Mike Wahler: "Re: Increasing efficiency in C"
- Next in thread: jacob navia: "Re: Increasing efficiency in C"
- Reply: jacob navia: "Re: Increasing efficiency in C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|