comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org>
Subject: Re: [SPARK] Code safety and information hiding
Date: Fri, 18 Aug 2006 01:22:02 GMT
Date: 2006-08-18T01:22:02+00:00	[thread overview]
Message-ID: <_C8Fg.96140$FQ1.5902@attbi_s71> (raw)
In-Reply-To: <7V3Fg.13573$E02.5018@newsb.telia.net>

Bj�rn Persson wrote:
> 
> Do you call them state variables even when they're local in a subprogram 
> and "global" only to a nested subprogram?

Generally, no. State should usually be encapsulated in a package. In the 
context of SPARK's "own" and "global" annotations, state for a 
state-machine package is what I was discussing. There are cases where a 
main subprogram is essentially a state machine and simply calls 
subprograms that operate on the state, and I've hacked out a few of 
those in my day. In retrospect, though, a better and more thorough 
design, with better encapsulation of the state, would have been better.

Variables such as you discuss, though, don't generally have the negative 
effects of true global variables, found in library-level package specs. 
I've seen safety-critical SW designed around thousands of such variables 
in hundreds of packages, with absolutely no documentation. This results 
in maximal coupling and minimal cohesion. I find such SW very difficult 
to understand, and don't understand how it was ever certified.

-- 
Jeff Carter
"I'm particularly glad that these lovely children were
here today to hear that speech. Not only was it authentic
frontier gibberish, it expressed a courage little seen
in this day and age."
Blazing Saddles
88



  reply	other threads:[~2006-08-18  1:22 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-16  7:56 [SPARK] Code safety and information hiding Maciej Sobczak
2006-08-16  8:53 ` roderick.chapman
2006-08-16 11:18   ` Stuart
2006-08-16 13:23     ` Maciej Sobczak
2006-08-16 19:49 ` [SPARK] " Jeffrey R. Carter
2006-08-17  7:01   ` Maciej Sobczak
2006-08-17 18:08     ` Jeffrey R. Carter
2006-08-17 20:00       ` Björn Persson
2006-08-18  1:22         ` Jeffrey R. Carter [this message]
2006-08-18 19:39           ` Björn Persson
2006-08-19  5:35             ` Jeffrey R. Carter
2006-08-19 12:47               ` Björn Persson
2006-08-20  3:58                 ` Jeffrey R. Carter
2006-08-20 11:35                   ` Björn Persson
2006-08-18 23:02   ` Robert A Duff
2006-08-19  5:40     ` Jeffrey R. Carter
2006-08-19  9:49       ` Stephen Leake
2006-08-20  3:52         ` Jeffrey R. Carter
2006-08-20 19:06           ` Stephen Leake
2006-08-21  1:07             ` Jeffrey R. Carter
2006-08-21  7:25               ` Maciej Sobczak
2006-08-21 19:31                 ` Jeffrey R. Carter
2006-08-21 19:58                   ` Dmitry A. Kazakov
2006-08-21 21:06                     ` Björn Persson
2006-08-22  7:16                       ` Maciej Sobczak
2006-08-22  9:45                         ` Björn Persson
2006-08-22 12:42                           ` Maciej Sobczak
2006-08-22  7:27                       ` Dmitry A. Kazakov
2006-08-21 11:30             ` Colin Paul Gloster
2006-08-22 10:51               ` Stephen Leake
2006-08-23  9:44     ` Peter Amey
2006-08-23 22:37       ` Jeffrey R. Carter
2006-08-24 10:55         ` Peter Amey
2006-08-24 23:33           ` Jeffrey R. Carter
replies disabled

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