News for hackers. Stuff that matters.
Re:Why does sorting in computer science mean ordering rather... by outsidetheparty on Wednesday September 05, 2018 @03:09PM (#17920986)
Maybe it's just because I've spent too long with computers, but I thought the everyday meaning of "sorting" was ordering, not categorizing.

(Though now that I think about it, it's both: if I handed a random non-coder a deck of cards and asked them to sort them, I'd expect them to group by suit and then order by value. I wouldn't expect four stacks by suit in random order, or a deck of all the cards in numerical order regardless of suit...)

That nitpick aside, it was a good excuse to get into the interesting pre-digital computing history stuff.

Re:Why does sorting in computer science mean ordering rather... by o_nate on Wednesday September 05, 2018 @03:32PM (#17921139)
I had the same initial reaction, but the dictionary supports the idea that the everyday usage of sort means to group by category, not to order. I've probably just been coding too long as well.
Re:Why does sorting in computer science mean ordering rather... by outsidetheparty on Wednesday September 05, 2018 @07:07PM (#17922606)
You’re right, it does! I wonder if the definition is going to drift towards “ordering” as computing becomes ever more ubiquitous, or if we’re just in a linguistic cul de sac by virtue of our profession...
Re:Why does sorting in computer science mean ordering rather... by alanbernstein on Thursday September 06, 2018 @12:06AM (#17923794)
Are you referring to a dictionary of word definitions? The kind that is structured as a list of words, ordered lexicographically? Where is the categorization in that?
Re:Why does sorting in computer science mean ordering rather... by outsidetheparty on Thursday September 06, 2018 @07:58AM (#17925593)
He's referring to the dictionary definition of the word "sort".

Dictionary.com has it as "to arrange according to sort, kind, or class; separate into sorts; classify". I looked it up in the OED too -- mostly because we have one and I don't get enough excuses to use its nifty little magnifying glass -- and it also supports the notion that it means by category, not by order. The general verb definition is "to arrange things according to kind or quality", and there's a separate definition for software: "sort: Computers: the action of arranging items of data in a prescribed sequence".

Re:Why does sorting in computer science mean ordering rather... by mort96 on Thursday September 06, 2018 @03:59AM (#17924618)
What do you mean? I agree that dictionaries are ordered and not categorized, but do dictionaries claim to be sorted?
Re:Why does sorting in computer science mean ordering rather... by alanbernstein on Thursday September 06, 2018 @11:09AM (#17926814)
I thought parent was using "the sortedness of dictionaries" as his argument, I now realize he meant "the dictionary definition of 'sort'".
Re:Why does sorting in computer science mean ordering rather... by SilasX on Wednesday September 05, 2018 @06:52PM (#17922540)
I definitely think it's reasonable that someone might say e.g. "sort these coats by color" and expect them to be bucketed like-with-like, but not imply any kind of ordering (either within or across buckets).
Re:Why does sorting in computer science mean ordering rather... by Double_a_92 on Thursday September 06, 2018 @04:23AM (#17924709)
What if the coats all had different but similar colors? The process would be the same, just that you have to split them into arbitrary "buckets" at the end.
Re:Why does sorting in computer science mean ordering rather... by adamzochowski on Wednesday September 05, 2018 @03:24PM (#17921097)
There are phrases using word sort as a category: "this sort of people" , "sort of liked".
Re:Why does sorting in computer science mean ordering rather... by dspillett on Thursday September 06, 2018 @05:57AM (#17925056)
> but I thought the everyday meaning of "sorting" was ordering, not categorizing

I think I've always thought of ordering as a subset of sorting, not something different, both in computing and in "real life" language use.

When sorting washed laundry I categorise by type and order by a fairly arbitrary mix of target position (undies in the top left draw, socks top right, daily t-shirts the draw below, "better" t-shirts the draw below that, then trousers, ...), hue/pattern/subject, and a few other properties. As with your cards example there are both grouping and ordering operations present in the sorting operation (in the cards example there might be two orderings: one for the suits if you want them to be in a specific order and one by the value of the cards within the suit).

Sorting numbers in a computer seem quite different: each category has at most one item and the are ordered by the same property they are categorised by, but the process is similar enough.

And sorting in computing is not always simply ordering. There are many examples where it is categorising (just by some variety of ordinal value). Some sorting algorithms explicitly categorise the input data as a divide-and-conquer process. Sometimes you don't care about the precise ordering (but it is done precisely anyway because a fuzzy sort would be no more performant).

The only examples that immediately jumps to mind where there is a definite distinction made are data management languages where there is a distinction between ordering and grouping (quite explicitly seen in SQL's "order by" and "group by" clauses), and even there I know that internally ordering/grouping/both are performed by what I would identify as a sort operation.

Sorting doesn't mean something different in computing really, people just tend to pick out a more specific definition in that context.

Re:Why does sorting in computer science mean ordering rather... by irrational on Wednesday September 05, 2018 @03:37PM (#17921196)
The example that comes to my mind is a pile of wooden blocks. If I was asked to sort them I sort them by shape (i.e., by category). Here is a pile of the square ones, here are the circle ones, etc.

If I was sorting lego blocks I don't know if I would do it first by color and then by size/shape (here are all the 2x8s, here are all the 1x4s, etc.), but it would definitely be by category.

Re:Why does sorting in computer science mean ordering rather... by jfoutz on Wednesday September 05, 2018 @03:46PM (#17921278)
lego is funny, if you have a pile of red 'stuff' it's hard to pick out the 2x8. however, if you have a pile of 2x8s, it's really easy to pick out the red one.

size/shape is far more useful.

Re:Why does sorting in computer science mean ordering rather... by tomgp on Thursday September 06, 2018 @04:54AM (#17924817)
This is a well known idea in data visualisation -- first articulated by Jaques Bertin back in the 60s (I think). Colour is known as a selective visual variable; selective variables are better used to represent categorical data as they "enable us to immediately isolate all correspondences belonging to the same category". i.e. sort your lego by bricks type rather than colour, though sorting by colour will lead to more instagram likes :)
Re:Why does sorting in computer science mean ordering rather... by jayd16 on Wednesday September 05, 2018 @06:40PM (#17922468)
Hmm, when playing with lego, I usually don't know what shapes I need but I often know what color I want.
Re:Why does sorting in computer science mean ordering rather... by gowld on Wednesday September 05, 2018 @09:05PM (#17923190)
Yes, but you don't need to sort them by color, because you can easily see which pieces are the color you want.
Re:Why does sorting in computer science mean ordering rather... by bena on Wednesday September 05, 2018 @05:04PM (#17921913)
Yes, color looks nicer, but shape is more useful.
Re:Why does sorting in computer science mean ordering rather... by kolderman on Wednesday September 05, 2018 @10:33PM (#17923534)
> but I thought the everyday meaning of "sorting" was ordering, not categorizing

Go ask your wife how she sorts the laundry.

Re:Why does sorting in computer science mean ordering rather... by too-soon-ago on Wednesday September 05, 2018 @04:33PM (#17921654)
The meanings are the same. In one case you're sorting a set of items which are all unique, whereas in the other there are some duplicates under the sorting key. If you sort by just the suit of the cards, you have clusters that are of the same suit. It's only in the very-precise world of programming that a set versus a set of sets makes much of a difference.
Re:Why does sorting in computer science mean ordering rather... by tomgp on Thursday September 06, 2018 @04:56AM (#17924828)
no, its more like a set of sets vs an ordered set of sets
Re:Why does sorting in computer science mean ordering rather... by josephv on Wednesday September 05, 2018 @04:58PM (#17921848)
I think this is a valid critique of the title. Sorting means whatever it means in a specific context (dewey decimal system, post addresses, etc...).

Most languages are context sensitives, but generalized computing is fundamentally defined by a context free language in which a processing transition can execute and not care was previous states were. This gets blurry with recursion and generics and other syntactic sugar, but fundamentally state changes are still defined by the operation and instantaneous state and not the language itself.

So in our context-free language of generalized computers, sorting and ordering are the same.

Re:Why does sorting in computer science mean ordering rather... by dan-robertson on Wednesday September 05, 2018 @05:54PM (#17922233)
I can’t really tell what you mean but I suspect that it doesn’t make any sense.

What on Earth do you mean when you say “generalized computing is fundamentally defined by a context free language in which a processing transition can execute and not care was previous states were”?

Perhaps you are just writing context free/sensitive when you mean something different from “the set of words that may be formed by starting with some nonterminal symbol S, following rules of the form A -> xy where A is any nonterminal and x and y are either terminal or nonterminal symbols, repeating until there are no nonterminals left.”

If you really mean something about all computations being expressible in a context free language then I suppose I would have to agree but I put it to you that a regular language would be sufficient.

The other thing I can’t understand is what this has to do with either the parent or the article?