Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Abuse of "or next" in expressions and "next" that returns value

by AnomalousMonk (Archbishop)
on Jul 18, 2018 at 21:01 UTC ( [id://1218788]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1218788]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-20 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found