Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jul 1999 09:26:50 -0500
From:      "G. Adam Stanislav" <adam@whizkidtech.net>
To:        Dag-Erling Smorgrav <des@flood.ping.uio.no>
Cc:        chat@FreeBSD.ORG
Subject:   Re: Changing the value of Pi
Message-ID:  <19990730092650.A223@whizkidtech.net>
In-Reply-To: <xzpoggu1b3n.fsf@flood.ping.uio.no>; from Dag-Erling Smorgrav on Fri, Jul 30, 1999 at 04:11:24PM %2B0200
References:  <Pine.BSF.4.10.9907291008390.13541-100000@janus.syracuse.net> <199907291156.NAA06494@labinfo.iet.unipi.it> <19990730093259.A93194@freebie.lemis.com> <199907300302.XAA15392@khavrinen.lcs.mit.edu> <xzp7lni32ur.fsf@flood.ping.uio.no> <19990730085617.B228@whizkidtech.net> <xzpoggu1b3n.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 30, 1999 at 04:11:24PM +0200, Dag-Erling Smorgrav wrote:
> > Is this a trick question? You should just change one occurence in an
> > include file and run make.
> 
> You miss the point. Garrett was advocating the use of literal
> constants instead of centrally defined symbolic constants.

I have just re-read the original message, and you are right.

I have to side with you. Literal constants are dangerous. If you
misspell one, the compiler will have no objections. You may be
tearing your hair later on trying to figure out what's wrong with
your program.

If, on the other hand, you misspell a symbolic name, the compiler
will generally complain (I'm saying generally, because you may
misspell it into another symbolic name - a good reason not to
use similar names), and you will catch the error right away.

This, to me, is even more important than changing the value later
on (although, that is important as well).

Adam


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?19990730092650.A223>