Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: crafting a decent CLI

by Abigail (Deacon)
on Jul 13, 2001 at 18:51 UTC ( #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

Comment on Re: crafting a decent CLI
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?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2015-11-28 22:08 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls