[OT] Premature optimizations (was: Where is NSList?)
[OT] Premature optimizations (was: Where is NSList?)
- Subject: [OT] Premature optimizations (was: Where is NSList?)
- From: Allan Odgaard <email@hidden>
- Date: Thu, 29 Jul 2004 13:50:43 +0200
On 29. Jul 2004, at 11:17, Steve Checkoway wrote:
I'd suggest using NSArray/NSMutableArray for ordered collections,
and only worrying about their access characteristics if use and
profiling of your application point to them as a performance issue.
This is a *very* naive view which may well lead to O(n^2) or worse
implementations of O(1) problems!
Programmers are notorious for optimizing the wrong code.
What is your basis for that statement? which programmers are you
referring to?
The pervious point was well made and perfectly valid.
I disagree. If you understand time complexity, you mostly do not need
to profile your code to know how well it scales, and if you have
reusable data structures, you do not need to spend extra time making it
right from the start, rather than fix it when users complain that the
app is useless for larger quantities of data, or just ignore the
problem, which seems to be the case for half the apps I use... ;)
We have a lot of people which program whom doesn't have in depth
knowledge about data structures and time complexity, and I think it's a
disservice to these to almost label optimizations as a bad thing. What
we could preach is how to do proper optimizations, and choosing the
proper data structure is the first step, which was all the OP wanted...
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.