lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m3hcqsbm35.fsf@maximus.localdomain>
Date:	Fri, 04 May 2007 18:16:46 +0200
From:	Krzysztof Halasa <khc@...waw.pl>
To:	Jiri Slaby <jirislaby@...il.com>
Cc:	Oliver Neukum <oliver@...kum.org>, linux-kernel@...r.kernel.org
Subject: Re: [patch]clarification of coding style regarding conditional statements with two branches

Jiri Slaby <jirislaby@...il.com> writes:

> Why, what's wrong with
> if (condition) {
> 	do_this();
> 	do_that();
> } else
> 	otherwise();
>
> ? It's more readable/nicer in my eyes than

I think so. And it means less lines #.

>> +if (condition) {
>> +	do_this();
>> +	do_that();
>> +} else {
>> +	otherwise();
>> +}

Exception:

if (x) {
	if (y)
		foo1();
	else
		foo2();
} else
	bar();

The braces after if(x) are needed so nobody thinks it's:

if (x)
	if (y)
		foo1();
else
	foo2();
else
	bar();

-- 
Krzysztof Halasa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ