Oh fun another style discussion! :-)<p>My own taste is for a "book style": write the code like you see in good books. I agree with most of this guide, although I'm pretty loose and case-by-case in practice. I've gradually added rubocop to lots of my projects, but then I wind up disabling tons of the rules.<p>I'm sad all the Ruby guides I've seen ban "and" and "or". I don't find them to be such an issue, and they are nicer to type & read. For one thing you can say `foo or raise "msg"` but need parens to say `foo || raise("msg")`. On team projects I sigh and go along with it, but it is a shame.<p>Speaking of "book style": I have a bunch of Python books with atrocious style, e.g. no spaces between operators or even between function arguments. How can anyone read that? I even see this from high-quality publishers like O'Reilly. What is going on with the Python world? Are their thumbs tired from all that indentation, so they leave out spaces everywhere else? ;-)<p>I really want to write a SQL style guide. There seems to be almost no consensus. My own formatting is idiosyncratic and not super principled, but I feel it is the most readable and expresses structure the best. It looks like this:<p><pre><code> SELECT a, b
FROM t1
LEFT OUTER JOIN t2
ON t2.t1_id = t1.id
WHERE t2.c = 'foo';
</code></pre>
(EDIT: Sorry, t2.c = 'foo' is a pretty dumb thing to do in an outer join. :-)<p>Other people like to do one or more of these things:<p><pre><code> SELECT a
, b
FROM t1
LEFT OUTER JOIN t2 ON t2.t1_id = t1.id
WHERE t2.c = 'foo';
</code></pre>
In other words:<p>- lead with the comma in SELECT.<p>- ragged left edge but line up all the single spaces in a column.<p>- indent the joins.<p>Anyway sorry for the rambling. :-) There is some observation that committees spend 90% of their time on trivial details and hardly discuss any of the important stuff, and style is no exception. But who doesn't like giving their opinion? :-)