Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 May 2010 14:26:42 +0400
From:      Alexander Churanov <alexanderchuranov@gmail.com>
To:        Eitan Adler <lists@eitanadler.com>
Cc:        hackers@freebsd.org
Subject:   Re: proposed change to style(9): require yoda style if statements
Message-ID:  <AANLkTilOEAT1W8SrdFYd2S6wVMnX0SpRn6kdiC8Cf8nS@mail.gmail.com>
In-Reply-To: <AANLkTimCLELSQ9YNZ403_PLhKOQCQTcl9H1bfb1ccRNb@mail.gmail.com>
References:  <AANLkTimCLELSQ9YNZ403_PLhKOQCQTcl9H1bfb1ccRNb@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2010/5/11 Eitan Adler <lists@eitanadler.com>:
> My proposal is simple:
> require that any if statement that compares a constant to a mutable variable
> be written as
> if (constant == variable)
> instead of
> if (variable == constant)

Use "const" qualification. It's portable and does not require
rewriting conditionals in any way.

Alexander Churanov



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTilOEAT1W8SrdFYd2S6wVMnX0SpRn6kdiC8Cf8nS>