Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Feb 2001 08:40:58 +0100
From:      Rahul Siddharthan <rsidd@physics.iisc.ernet.in>
To:        "Michael C . Wu" <keichii@peorth.iteration.net>
Cc:        j mckitrick <jcm@FreeBSD-uk.eu.org>, freebsd-chat@FreeBSD.ORG
Subject:   Re: bad programming practice?
Message-ID:  <20010224084058.A50136@lpt.ens.fr>
In-Reply-To: <20010223143019.E32113@peorth.iteration.net>; from keichii@iteration.net on Fri, Feb 23, 2001 at 02:30:20PM -0600
References:  <20010223180321.A33329@dogma.freebsd-uk.eu.org> <20010223143019.E32113@peorth.iteration.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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