(original) (raw)
Let's not switch to either of those options. Visually I much prefer either of these:
if (test) {}
}
On Tue, Jan 19, 2016 at 10:29 AM, Ethan Furman <ethan@stoneleaf.us> wrote:
On 01/19/2016 08:56 AM, Jim J. Jewett wrote:
That "otherwise" gets a bit awkward, but I like the idea. Perhaps
"braces must not be omitted, and should normally be formatted as
follows. ... Where other C styles would permit a braceless one-liner,
the expression and braces may be moved to a single line, as follows: "
if (x > 5) { y++ }
I think that is clearly better, but it may be \*too\* lightweight for
flow control.
if (!obj)
{ return -1; }
does work for me, and I think the \\n{} may actually be useful for
warning that flow control takes a jump.
Either of those two, with preference for the second on multiline ifs, seems quite readable to me.
\--
\~Ethan\~
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido%40python.org
--
--Guido van Rossum (python.org/\~guido)