Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: crafting a decent CLI (do if?!)

by tye (Sage)
on Jan 28, 2008 at 03:17 UTC ( [id://664615]=note: print w/replies, xml ) Need Help??


in reply to Re: crafting a decent CLI
in thread crafting a decent CLI

I'm pretty sure I've never seen "do { ... } if ...;" or similar. That is so pointlessly obfuscated that it is something I would avoid (such as in a coding standard) even more than I would avoid bare blocks as loops (which I also find can always be replaced with better alternatives). So I still jump to "loop" when I see ";\ndo {\n" and I will continue to. I also still don't jump to "loop" when I see a lone open bracket (and nobody should since most of the time they'd be wrong anyway).

So a do loop is clearer than a bare block "loop". True, there is no guarantee against somebody writing something that clearly looks like a loop but is in fact an unclear and uselessly obfuscated non-loop. That isn't a concern when trying to decide how to make code easy to maintain. If you've got "do { ... } if ...;" in your code, then you've got worse problems to deal with first.

- tye        

Log In?
Username:
Password:

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

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

    No recent polls found