comp.lang.ada
 help / color / mirror / Atom feed
From: "Dr. Peter E. Obermayer" <obermaye@cci.de>
Subject: Re: GNAT messages and the not operator (pitfall alert!)
Date: 1996/10/30
Date: 1996-10-30T00:00:00+00:00	[thread overview]
Message-ID: <3277C5F1.3F4E@cci.de> (raw)
In-Reply-To: 54snn6$8j5@newsbf02.news.aol.com


John Herro wrote:

-- Discussion on parntheses deleted

> I'm not saying that the code
> 
>    if X**2 + 3.0*X + 2.0 < 100.0 then ...

Better (X + 3.0)*X + 2.0 < 100.0

> 
> should be cluttered with unnecessary parentheses.  Everyone knows that
> "**" comes before "*" and "/", which come before binary "+" and "-", and
> everyone knows that the relational operators have a low precedence.  It's
> also arguable that "everyone" knows that "and" comes before "or".  But I'd
> say in almost every other case, unless the order of evaluation is very
> obvious, use parentheses!
> 
> Even Ada has some pitfalls.  If everyone followed this rule, one of them
> would be no problem.
> 
> - John Herro
> Software Innovations Technology
> http://members.aol.com/AdaTutor
> ftp://members.aol.com/AdaTutor


Peter E. Obermayer

   _/_/_/ _/_/_/ _/_/_/ Dr. Peter E. Obermayer 
  _/     _/       _/                           Tel.:   xx49(5931)805-469
 _/     _/       _/     Lohberg 10             Fax:    xx49(5931)842-469
_/_/_/ _/_/_/ _/_/_/    D-49716 Meppen         e-mail: obermayer@cci.de




  parent reply	other threads:[~1996-10-30  0:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-24  0:00 GNAT messages and the not operator (pitfall alert!) Robert Dewar
1996-10-24  0:00 ` Robert Dewar
1996-10-25  0:00   ` whiting_ms@corning.com (Matt Whiting)
1996-10-26  0:00     ` David C. Hoos, Sr.
1996-10-27  0:00     ` Robert Dewar
1996-10-28  0:00       ` Matthew S. Whiting
1996-10-26  0:00   ` John Herro
1996-10-26  0:00     ` Matthew Heaney
1996-10-29  0:00       ` Robert Dewar
1996-10-26  0:00     ` Robert Dewar
1996-10-29  0:00       ` John Herro
1996-10-29  0:00         ` Robert Dewar
1996-10-30  0:00     ` Dr. Peter E. Obermayer [this message]
1996-10-30  0:00       ` John Herro
1996-10-30  0:00         ` Robert Dewar
1996-11-01  0:00         ` User Password expiration date extractor? Stein-Aksel Basma
1996-10-29  0:00   ` GNAT messages and the not operator (pitfall alert!) Norman H. Cohen
1996-10-29  0:00     ` whiting_ms@corning.com (Matt Whiting)
1996-10-30  0:00       ` Robert Dewar
1996-10-30  0:00       ` Norman H. Cohen
1996-11-06  0:00         ` Richard A. O'Keefe
1996-11-18  0:00           ` Norman H. Cohen
1996-11-18  0:00             ` Robert Dewar
1996-10-30  0:00       ` David C. Hoos, Sr.
1996-10-30  0:00         ` whiting_ms@corning.com (Matt Whiting)
1996-10-30  0:00           ` Norman H. Cohen
1996-11-05  0:00     ` Robert Dewar
1996-10-28  0:00 ` Cary Jamison
1996-10-29  0:00   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox