in reply to Abuse of "or next" in expressions and "next" that returns value

I can't comment on the internals of the deparser, but...

... to me, the #2 is more readable ...

Everyone has their own notion of what is understandable and readable. To me, fragment 1 is way more readable, understandable and maintainable — today, tomorrow, in a year, in a decade.

The only circumstance in which I might deploy something like fragment 2 is if the simple-seeming code of fragment 1 actually harbored some perverse and devilish subtlety that I did not trust myself to convey clearly in a comment (or if I didn't trust the maintainers to pay attention to comments). In such a case, I might write my code in such a way as to bring casual perusal to a screeching halt and cause a reader to proceed only with the greatest trepidation and attention to each detail; a huge mental speed-bump as it were. But I normally try to avoid writing speed-bumpy code.

Update: A few minor wording changes.


Give a man a fish:  <%-{-{-{-<

  • Comment on Re: Abuse of "or next" in expressions and "next" that returns value
  • Download Code