From owner-freebsd-hackers@FreeBSD.ORG Tue May 11 21:39:27 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49783106564A for ; Tue, 11 May 2010 21:39:27 +0000 (UTC) (envelope-from shteryana@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id BC7128FC17 for ; Tue, 11 May 2010 21:39:26 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so148958fgb.13 for ; Tue, 11 May 2010 14:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:reply-to:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=cjOxCkdkxARWkktbe5YjDbdQNHHOmAxYNAhjwtAWJL4=; b=RsB+krjW2+mOpdNOqCDg9Ug4ALoYXEqFunrdWn2hlGceu5tKY2Ak2RsLt7N3sXT0R4 MtJJ47tefB4rlsCLu4sqG3CTQJQYoNLRga59SJWWwx9butrzJ0chAALVfaXiNKpqDkCi EAGZMX0C8+NbFGpZYi/JipgjDZgYuNX8o5Q3g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=WpiQ8o0n59au0PA91ymjthhjB6eB/LXhhsKoqTvaRGGYmR3VDDk060Z3mpN+w7bZLf nVa/QtkTnHamPANAtzbCECoAFnjv5u+ng0ol5zVmjJz1mFj9tfdZ7+7WITfazA67E98M 73cqh0qLBo0bO/QitkSD/hU7BkMhypp4QMEo4= MIME-Version: 1.0 Received: by 10.223.24.85 with SMTP id u21mr7070153fab.8.1273612458818; Tue, 11 May 2010 14:14:18 -0700 (PDT) Sender: shteryana@gmail.com Received: by 10.223.126.138 with HTTP; Tue, 11 May 2010 14:14:18 -0700 (PDT) In-Reply-To: References: <201005112233.24473.max@love2party.net> Date: Wed, 12 May 2010 00:14:18 +0300 X-Google-Sender-Auth: LLG7wGKpnxpRnqkvZkJhZ7b21BI Message-ID: From: Shteryana Shopova To: Eitan Adler Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Max Laier , freebsd-hackers@freebsd.org Subject: Re: proposed change to style(9): require yoda style if statements X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: syrinx@FreeBSD.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 May 2010 21:39:27 -0000 In my humble opinion, With proper -W flags (i.e. -Wall -Werror), the compilation will fail on "if (var =3D const)" also yoda statements of the kind if (constant =3D=3D variable) obfuscate code and make it more difficult to read, definately not a good idea IMHO, added the confusion between old and new code that Max mentioned. cheers, Shteryana On Tue, May 11, 2010 at 11:36 PM, Eitan Adler wrote: >> With proper -W flags, "if (var =3D const)" also yields a warning: >> >> =C2=A0warning: suggest parentheses around assignment used as truth value >> >> Chaning style(9) in such a fundamental way almost, always isn't a good i= dea. >> It's simply unrealistic to change all current code to comply and the >> difference between old and new code will just add to the confusion. > > Per Julian Elischer > We might suggest it rather than mandate it. > Also this method is compiler agnostic and generates a stronger warning > (an error rather than a warning) > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >