Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Logical expression style

by greenFox (Vicar)
on Jul 13, 2002 at 03:54 UTC ( #181450=note: print w/replies, xml ) Need Help??


in reply to Logical expression style

I tend to go for the operator at the end style though I tend to agree with those who have pointed at that a trailing comment will mask the operator.

I am wondering if style in this instance at least is partly a function of how you read code- if you skim down the code by focussing on the line beginnings you might want the operator there so you can immediately recognise it as part of the previous line. If (this is what I tend to do) you skim by focussing on the beginning and the end of the line (without paying too much attention in between) having the operator on the end makes sense, it allows evaluation of the line to take place without reading the next line or tells you "nope more to come on this".

I think I have a built in regexp that looks for ";" or "{" or an operator on the end of the line and reports a bug if it doesn't find one :) - since I don't often work on any-one else code it's not too much of a problem :)

--
Until you've lost your reputation, you never realize what a burden it was or what freedom really is. -Margaret Mitchell

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2022-08-08 18:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?