in reply to Re: Clever vs. Readable
in thread Clever vs. Readable

but in this case he's absolutely spot on.

spot on? nightmare? so what does he say about the Schwartzian transform? hell of a nightmare, I guess. He's not spot on choosing a too simple construct to make an argument of readability vs. maintainability. A perl code maintainer needs a training in TIMTOWTDI, and this one is a good piece of code for that.

Replies are listed 'Best First'.
Re^3: Clever vs. Readable
by Porculus (Hermit) on Aug 10, 2008 at 11:30 UTC

    The Schwarzian transform is a standard and widely used Perl idiom. This "min" example is neither of those things. You can't really compare them.

    While Perl programmers do need to understand TIMTOWTDI, they also need to understand that some of those ways are rarely appropriate. This is indeed a great example to teach them that with -- precisely because it's so unreadable. It's a great example of OWTDI that IMO few experienced programmers would seriously consider for use in production code.

    (FWIW, IIRC PBP has nothing against the ST but recommends that it be preceded by a comment identifying the construct.)