comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Converting access values
Date: 07 Jan 2005 17:15:26 -0500
Date: 2005-01-07T17:15:26-05:00	[thread overview]
Message-ID: <wccekgwyjgh.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: tcWdnexnt8SRYUPcRVn-1A@megapath.net

"Randy Brukardt" <randy@rrsoftware.com> writes:

> "Mark Lorenzen" <mark.lorenzen@ofir.dk> wrote in message
> news:m31xcxdnoz.fsf@0x53586c58.boanxx18.adsl-dhcp.tele.dk...
> ...
> ...
> > It solves the problem, but exposes a bit more information to the
> > clients than necessary. It is very easy for a client to address a
> > slice outside the bounds:
> >
> > Buffer.Data (Buffer.First - 10 .. Buffer.Last + 15)
> >
> > But there is of course also the risk of over-engineering the buffer,
> > so I will settle with the above design.
> 
> I understand, but you had said that performance was critically important
> here. When that's the case (and remember that it is very rare that it is),
> you have to toss abstraction and OOP and all of that other good stuff that
> eats ups a bit of performance in favor of getting the job done. So I
> wouldn't worry too much about that small safety hole. (It's perfectly
> reasonable to look for a solution that doesn't give up that stuff, but silly
> to obsess about it.) The important thing is that the code with the guts
> hanging out be limited to a small, critical part of the system, and it seems
> that you are doing that.

Right.  And one can ameliorate the problem with a coding convention:
At the start of each procedure that messes with these things,
declare:

    Buf: ... renames Buffer.Data(Buffer.First..Buffer.Last);

and then refer only to Buf in there.

- Bob



  reply	other threads:[~2005-01-07 22:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-05 22:31 Converting access values Mark Lorenzen
2005-01-05 23:32 ` Stephen Leake
2005-01-05 23:51   ` Mark Lorenzen
2005-01-06  0:18 ` Jeffrey Carter
2005-01-06  0:28   ` Mark Lorenzen
2005-01-07 16:55     ` Nick Roberts
2005-01-07 19:49       ` Mark Lorenzen
2005-01-07 20:23         ` Nick Roberts
2005-01-07 21:23           ` Robert A Duff
2005-01-11 17:02             ` Upkeep
2005-01-11 21:37               ` Robert A Duff
2005-01-12  4:56                 ` Alexander E. Kopilovich
2005-01-12 10:48                 ` Dmitry A. Kazakov
2005-01-07 21:17         ` Randy Brukardt
2005-01-07 22:15           ` Robert A Duff [this message]
2005-01-06 10:52 ` Dmitry A. Kazakov
2005-01-06 11:02 ` Duncan Sands
2005-01-06 12:17   ` Martin Dowie
2005-01-06 19:30   ` Mark Lorenzen
2005-01-06 20:40     ` Randy Brukardt
replies disabled

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