From: Navindra Umanee Date: 2005-03-29T00:14:37+09:00 Subject: Re: ! haphazard bertrandmuscle@yahoo.com wrote: > this is very interesting, thank you. > > but for myself and perhaps many other users it comes down to how > intuitive the language is. from this perspective: if sort! works, > sort_by! should also. > > one of the things that drew me to ruby recently was this philosophy, but > there have been some off-putting inconsistencies. There is no substitute for understanding what the algorithm is doing and the efficiency implications... it is not about intuition or consistency. It might be about documentation. sort_by has efficiency tradeoffs and advantages compared to sort, and as previously explained it doesn't make sense to have a sort_by! As another example, MergeSort is a stable sort and QuickSort is an unstable sort... would it make sense to have an unstable implementation of MergeSort and a stable implementation of QuickSort for intuitive and consistency purposes? Cheers, Navin.