Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: crafting a decent CLI

by Abigail (Deacon)
on Jul 13, 2001 at 18:51 UTC ( [id://96417]=note: print w/replies, xml ) Need Help??


in reply to (tye)Re3: crafting a decent CLI
in thread crafting a decent CLI

The point isn't that you find it sensible or not. The point was how easy it was for others to parse your code. You weren't assuming I had to parse the bare block I wrote to see whether it's used as a multi-pass loop, do you? I wrote it, so I know.

If you want to get into style discussions, that's fine, but don't come with arguments "oh, I don't find it sensible so don't apply my arguments on my code".

-- Abigail

Replies are listed 'Best First'.
Re^2: crafting a decent CLI (do if?!)
by tye (Sage) on Jan 28, 2008 at 03:17 UTC

    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://96417]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-18 13:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found