Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://17711]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2022-05-22 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (80 votes). Check out past polls.

    Notices?