so:

> Isn't simplicity and understandability favors the in-place style on these  
> type of algorithms?

Nope, functional-style code is what you are looking for :-)


> As Jesse Phillips said, it is same as sort.

You have to think of the normal sort as a performance hack, something that is 
good because copying data wastes a lot of time, if the array is large or if you 
have to sort an many small arrays. Normally in Python you prefer sorted(), that 
returns a sorted copy, unless performance is important. I'd like something like 
sorted() in D too.

In a program there is code that's performance-critical, and other code that's 
not changing the total runtime much. Often the second kind of code is a good 
part of the whole program. In this part you want very short, readable, safer 
code, even functional-style :-)

Bye,
bearophile

Reply via email to