Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: On goto

by Aristotle (Chancellor)
on Mar 01, 2003 at 16:04 UTC ( #239712=note: print w/ replies, xml ) Need Help??


in reply to •Re: Re^2: On goto
in thread On goto

No, I was not golfing. You're right that it could do with just a hint more punctuation - grep BLOCK would be better than grep EXPR here.

I disagree that it's hard to understand - only if you've never seen that grep idiom before. Personally I use it all the time, so I don't even have to think about it when I read one anymore.

I do think it reads naturally:

Ask   for   a database type   (default is mysql).
Say "Sorry",   then try again
      if you can't   find   an entry   like   the requested database   in the list of databases.

I like to choose my code structure so that it maps as closely to a natural language description of what it's trying to do as possible.

In contrast, I'd never use your no-block example because it violates that principle.

Makeshifts last the longest.


Comment on Re^4: On goto

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2015-07-04 04:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls