comp.lang.ada
 help / color / mirror / Atom feed
From: Martin <martin.dowie@btopenworld.com>
Subject: Re: Simple Warnings Needs
Date: Wed, 23 Feb 2011 13:55:54 -0800 (PST)
Date: 2011-02-23T13:55:54-08:00	[thread overview]
Message-ID: <8b826007-6846-4477-a6e0-91ad08b32bc7@p12g2000vbo.googlegroups.com> (raw)
In-Reply-To: 8aaf3582-0cc1-4c5f-ab85-eeb7ba569d9e@glegroupsg2000goo.googlegroups.com

On Feb 23, 6:52 pm, Rego <pablo.r...@embraer.com.br> wrote:
>  ** "-gnatwk" (Variables that could be constants)

A rationale behind this one is that by explicitly declaring items as
constants you can prevent _accidental_ modification. It's also a nice
visual queue to a reader that the value is deliberately set once and
once only, or they are left to wonder why a variable is defined and
set once but never again - is that a bug?

I seem to remember an article by Dewar explaining why constants can
rarely be optimized but I can't put my finger on it at the moment...

HTH
-- Martin




  parent reply	other threads:[~2011-02-23 21:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 18:52 Simple Warnings Needs Rego
2011-02-23 19:56 ` mockturtle
2011-02-23 23:07   ` jpwoodruff
2011-02-23 20:06 ` Ludovic Brenta
2011-02-23 21:55 ` Martin [this message]
2011-02-24  8:26   ` Markus Schöpflin
2011-02-26  3:51     ` Rego
replies disabled

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