When I see a Swartzian Transform, I think, "Ah! he's sorting the data".Yeah, but it might take a few brainbeats to notice you're looking at an ST. The sort is bookended between two maps, but not any map/sort/map pipeline is an ST.
If I see:
it's immediately clear data is sorted. Regardless of how complex the expression is,@a = sort {COMPLEX EXPRESSION <=> COMPLEX EXPRESSION} @b
takes more time to register that data is sorted, and just sorted.@a = map {$_->[0]} sort {$a->[1] <=> $b->[1]} map {[$_, COMPLEX EX +PRESSION]} @b
ST's feature is speed. Not readability.
In reply to Re^8: Thread on Joel on software forum : "I hate Perl programmers."
by Anonymous Monk
in thread Thread on Joel on software forum : "I hate Perl programmers."
by techcode
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |