Re: WTF? How can this work?
Re: WTF? How can this work?
- Subject: Re: WTF? How can this work?
- From: Chris Gehlker <email@hidden>
- Date: Mon, 20 Aug 2001 10:41:40 -0700
On 8/20/01 2:43 AM, "John C. Randolph" <email@hidden> wrote:
>
On Sunday, August 19, 2001, at 06:46 PM, Chris Gehlker wrote:
>
>
> On 8/19/01 3:07 AM, "Ondra Cada" <email@hidden> wrote:
>
>
>
>> 2nd BUT: security: if I am using an immutable class and I make a bug of
>
>> using is as if it were a mutable one, I suppose the app would stop and
>
>> write
>
>> a decent info to console!
>
>
>
> I can't agree here. I don't want ANY error checking overhead on
>
> fundamental
>
> methods of the fundamental containers.
>
>
You're in luck, because there isn't any error checking on the
>
fundamental containers. If you want an array with no bounds checking,
>
just say:
>
>
id unsafeArray[];
I am in luck because it looks like exactly what I wanted. I'm being sincere
here, this is not sarcasm. You've been very helpful. It looks like a plain
old C array with object semantics. Just the ticket.
However my enthusiasm is tempered by the fact that this doesn't seem to be
documented either in the online docs or on Apple's web site based on a quick
search. Could you please provide some pointers. I don't want to rely on some
implementation detail.
>
and then wait for somebody to exploit the buffer-overflow vulnerability
>
in your code.
This crack was unworthy of you, John.
>
NSArray and the like aren't the fundamental containers of the language,
>
they're much richer, safer, and easier to use.
Rich, safe and easy are fine. My only objection is when they come at the
expense of crude fast and efficient where that's needed. It's the old point
of not having to pay for what you don't use.
One of the beauties of Cocoa is that you can always resort to plain old C
where you need it. It looks like there may be other beauties but they await
adequate documentation to be revealed.
--
In the midst of great joy, do not promise anyone anything. In the midst of
great anger, do not answer anyone's letter. -Chinese proverb