From owner-freebsd-chat Fri Feb 23 23:41: 4 2001 Delivered-To: freebsd-chat@freebsd.org Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by hub.freebsd.org (Postfix) with ESMTP id F2DDC37B491 for ; Fri, 23 Feb 2001 23:41:01 -0800 (PST) (envelope-from Rahul.Siddharthan@lpt.ens.fr) Received: from corto.lpt.ens.fr (corto.lpt.ens.fr [129.199.122.2]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f1O7f0u46170 ; Sat, 24 Feb 2001 08:41:00 +0100 (CET) Received: from (rsidd@localhost) by corto.lpt.ens.fr (8.9.3/jtpda-5.3.1) id IAA50375 ; Sat, 24 Feb 2001 08:40:58 +0100 (CET) Date: Sat, 24 Feb 2001 08:40:58 +0100 From: Rahul Siddharthan To: "Michael C . Wu" Cc: j mckitrick , freebsd-chat@FreeBSD.ORG Subject: Re: bad programming practice? Message-ID: <20010224084058.A50136@lpt.ens.fr> Mail-Followup-To: "Michael C . Wu" , j mckitrick , freebsd-chat@FreeBSD.ORG References: <20010223180321.A33329@dogma.freebsd-uk.eu.org> <20010223143019.E32113@peorth.iteration.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010223143019.E32113@peorth.iteration.net>; from keichii@iteration.net on Fri, Feb 23, 2001 at 02:30:20PM -0600 X-Operating-System: FreeBSD 3.4-STABLE i386 Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Michael C . Wu said on Feb 23, 2001 at 14:30:20: > Personally, I think most C/C++ programmers eventually learn to always > watch for == vs. = mistakes right when they type the boolean expression. > Hence, the trick becomes useless as one advances. In this thread, I think this is the comment which really hits it. Think of it this way: any normal person would tend to write "if (n==1)". Now, to get around using = accidentally for ==, you either have to train yourself to write "if (1==n)" consistently every time, or you train yourself to check that == every time you write such an expression. Why not just train yourself to check the ==? Similarly, when reading someone else's code, if you train yourself to check the == you may catch such errors more easily. R To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message