• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: File Extensions Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File Extensions Problem


  • Subject: Re: File Extensions Problem
  • From: "Michael Ash" <email@hidden>
  • Date: Thu, 28 Aug 2008 11:52:46 -0400

On Wed, Aug 27, 2008 at 6:59 PM, R.L. Grigg
<email@hidden> wrote:
> Hmm, I guess the wrinkle in this particular case is if the "contract" doesnt
> specify something that the programmer assumes to be safe to do (like
> enumerating backwards), how can you know how to implement your end? I guess
> there are times when the underlying implementation details can/must
> influence your highlevel design?

When at all possible, your code should only be influenced by
underlying implementation details in the realm of performance, not
correctness.

This business of copying the array is a good example. It's fine to
write code that depends on the array no longer being copied, so long
as it still performs acceptably (although potentially worse) if the
array is copied.

There are a lot of cases where you have to make assumptions about
which technique is fastest, and this in turn depends on how those
techniques are implemented at a low level. But so long as your code
merely becomes slower when the assumptions change, but still
functions, this is generally not a problem.

In the case of enumerating backwards, the documentation says a lot
about how you should never mutate collections that you're enumerating
and nothing about it being safe to mutate while enumerating backwards.
The conclusion there should be obvious.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >File Extensions Problem (From: Adil Saleem <email@hidden>)
 >Re: File Extensions Problem (From: Andrew Merenbach <email@hidden>)
 >Re: File Extensions Problem (From: Graham Cox <email@hidden>)
 >Re: File Extensions Problem (From: Phil <email@hidden>)
 >Re: File Extensions Problem (From: Graham Cox <email@hidden>)
 >Re: File Extensions Problem (From: "Michael Ash" <email@hidden>)
 >Re: File Extensions Problem (From: Thomas Engelmeier <email@hidden>)
 >Re: File Extensions Problem (From: "R.L. Grigg" <email@hidden>)
 >Re: File Extensions Problem (From: Ken Thomases <email@hidden>)
 >Re: File Extensions Problem (From: "R.L. Grigg" <email@hidden>)

  • Prev by Date: Re: CFBundleIconFile: heiß or hot?
  • Next by Date: Re: Quitting all active applications
  • Previous by thread: Re: File Extensions Problem
  • Next by thread: Re: File Extensions Problem
  • Index(es):
    • Date
    • Thread