[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] sorting arrays



At 06:10 -0300 6/17/1999, Arved Sandstrom wrote:
Ronald's point being (and I agree with him) that the Schwartzian Transform
is a well-established and documented Perl sorting technique. Randal
Schwartz first identified and codified this usage (hence the name),
although the technique was certainly in use prior - it's just that nobody
else woke up to the general utility of it.

So, if nothing else, the S.T. is not a theoretical tangent.

I understand that it has potential benefit under some circumstances, but it struck me as unduly awkward to bother with in the context of the original question, e.g., how do I sort & print these names? If that's all you want to do, what's wrong with:

@fields = <INFILE>;
s/\|\|/, /g;
print sort @fields;

I have to agree with Ronald, again - why does elegance != simplicity in
your opinion? You're confusing elegance with obfuscation. True elegance IS
simplicity.

Elegance should equal simplicity, but at least in the context of programming, people tend to become obsessed with the tool instead of the task. There have been many times when I have foregone creating a MacPerl script to do something with text that could be done more crudely just by using grep in BBEdit. Maybe we just have different perspectives about the relative importance of the means versus the ends.


Richard Gordon
--------------------
Gordon Consulting & Design
Database Design/Scripting Languages
mailto:richard@richardgordon.net
http://www.richardgordon.net
770.565.8267