Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

RE: a question on style

by nuance (Hermit)
on Jun 12, 2000 at 18:43 UTC ( #17711=note: print w/replies, xml ) Need Help??


in reply to a question on style

It is not bad form to leave out the else if you are not using it. In fact I would say that the opposite is the case, adding an unused else is merely cluttering the code.

I would consider you second exapmle to be a mistake, but that's just my opinion.

If you type perlman:perlsyn into the search box It'll bring up the syntax documentation. As you can see the if statement with no else is the first quoted example i.e. it is good style

Nuance

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://17711]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2018-01-17 03:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (196 votes). Check out past polls.

    Notices?