in reply to Re^2: Perl style: Arguing against three-argument join() (++join '')
in thread Perl style: Arguing against three-argument join()

I think the first example you give is quite nice.

I quite dislike your second example, however. I find it far too difficult to map between the too-many format specifiers spread (rather willy-nilly) over multiple lines and the unnumbered list of expressions below. If the format specifiers had numbers or names, then it would bother me less. I understand your point of disliking having the over-all format broken up.

I've run into enough cases quite a bit longer than your second example and just don't find that sprintf scales to such situations. It can make quite clear code for the small cases, but I dislike the risk of variables being interpretted directly into the format string (because I've seen it happen so often when sprintf is used) and especially don't like how it doesn't scale. So I quickly jump to the method that scales the best, and also produces quite readable code, IMHO.

- tye        

  • Comment on Re^3: Perl style: Arguing against three-argument join() (scale)