• 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: NSMapTable with C strings as keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMapTable with C strings as keys


  • Subject: Re: NSMapTable with C strings as keys
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 29 May 2013 19:33:21 -0700

On May 29, 2013, at 6:30 PM, Ian Joyner <email@hidden> wrote:

> That seems to come out of a belief that well-structured code is code that runs poorly

No, it’s a paraphrase of a famous quote by Don Knuth ("We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.”[1]) He later attributed this to C.A.R. Hoare.

The main points behind this are, in my opinion, that: (a) you don’t ever have time to optimize the entire program, and (b) it’s often very unintuitive which parts of the code are bottlenecks. Additionally I find that (c) lots of the code I write ends up being scaffolding that’s going to get replaced anyway later on during development; and (d) heavily optimized code is often harder to maintain.

A more extreme version of this statement is the Ward Cunningham's mantra “Do The Simplest Thing That Could Possibly Work”[2].

I think these are two of the best lessons I’ve learned as I progressed in my craft. They've made me a lot more productive. There’s no point in optimizing something that never gets finished; and getting rat-holed into tweaking tiny details was really preventing me from getting things to the point where they were useable at all.

—Jens

[1] http://en.wikipedia.org/wiki/Program_optimization#When_to_optimize
[2] http://en.wikiquote.org/wiki/Ward_Cunningham#The_Simplest_Thing_that_Could_Possibly_Work
_______________________________________________

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


  • Follow-Ups:
    • Re: NSMapTable with C strings as keys
      • From: Ian Joyner <email@hidden>
References: 
 >NSMapTable with C strings as keys (From: Oleg Krupnov <email@hidden>)
 >Re: NSMapTable with C strings as keys (From: Graham Cox <email@hidden>)
 >Re: NSMapTable with C strings as keys (From: Oleg Krupnov <email@hidden>)
 >Re: NSMapTable with C strings as keys (From: Ian Joyner <email@hidden>)

  • Prev by Date: Re: NSMapTable with C strings as keys
  • Next by Date: Re: Dismissing menu from menu item that uses custom view
  • Previous by thread: Re: NSMapTable with C strings as keys
  • Next by thread: Re: NSMapTable with C strings as keys
  • Index(es):
    • Date
    • Thread