http://qs321.pair.com?node_id=181450


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