Re: more on stable sorting...
Re: more on stable sorting...
- Subject: Re: more on stable sorting...
- From: Steve Mykytyn <email@hidden>
- Date: Wed, 20 Nov 2002 12:13:46 -0800
agreed that a user click interface is simple, the added complexity for
the coder comes first from implementing some kind of way to remember
previous sorts, and then from having to deal with cases where a user
deletes or adds columns or rows following sorts. The nice part about
having an index produced by a stable sort is that it in some sense
"encodes" all the previous sorting history without having to fool
around with coding anything.
A stable sort would make me implement nothing to get the expected
behavior, as opposed to an "extremely simple" solution. I can't goof
up implementing nothing...
All in all, a stable option would be a nice thing that would save many
people from having to reinvent the wheel over and over again... and
the mainline sorting vendors, like SyncSort, have always provided this
and many other functions to control the way sorts are done.
Now I'm hesitating to suggest that it would be nice to have a "merge"
method to combine two ordered NSArrays...
On Wednesday, November 20, 2002, at 11:38 AM, matt neuburg wrote:
On Tue, 19 Nov 2002 12:20:53 -0800, Steve Mykytyn
<email@hidden> said:
memory. The best workaround for my purpose is to keep a small
persistent list of the most recently sorted columns, and use those to
break ties as needed. But a good deal of complexity, either user
interface or coding, is introduced with any solution i've come up
with
so far.
I don't understand that part of the statement. In a table, for
example, I can let the user sort a column by clicking the header, then
sort another column persistently by shift-clicking the header. That
not only is not a complex user interface, it is the expected user
interface. The code that deals with this works just as you describe
above and is extremely simple too. Since Cocoa lets you slot your own
comparison routine into any sorting action I just don't see what's to
be gained by having something built into the framework that is so easy
to implement yourself. m.
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
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.