comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: questions on Ada openGL binding in the GLOBE3D packages
Date: Thu, 2 Aug 2012 12:13:09 +0000 (UTC)
Date: 2012-08-02T12:13:09+00:00	[thread overview]
Message-ID: <jvdqsk$g6c$1@dont-email.me> (raw)
In-Reply-To: jvdgd7$5e3$1@speranza.aioe.org

On Thu, 02 Aug 2012 04:14:15 -0500, Nasser M. Abbasi wrote:

> On 8/2/2012 3:50 AM, Egil Høvik wrote:
>>  From the OpenGL spec:
>> "The declarations shown in this document apply to ANSI C.
>>Languages such as C++ and Ada that allow passing of argument type
>>information admit simpler declarations and fewer entry points."
>>
>>
>> So no, the names in an Ada-binding does not have to exactly match the C
>> version.
> 
> I know they do NOT HAVE TO be the same as C. That is my point.
> 
> They do NOT have to, yes, but it is _better_ if they DO.  Why not keep
> the names the same?

"Making code look the same as C" is ... not unambiguously better!

> It will make it easier to program this in Ada if the binding is the
> same.

No, but I'd agree it will make learning by following C examples a little 
bit easier. Which is important, up to a point.

Actually programming, and reading and maintaining such a program, is 
likely to be that much harder, as the names are longer,uglier and 
therefore less readable.

I confess I didn't watch this year's Tour de France. But I wonder, how 
many of the competitors used training wheels?

Just a point of view...

There is a long tradition among C programmers, of uglifying names as a 
poor substitute for properly indicating their type. But there is less 
than no reason to follow that tradition in Ada, where types and packages 
can be used to properly distinguish different entities.

So I would agree with Niklas' suggestion : if you must mimic the look of 
the C programs, substitute '.' for '_' and use qualified names. Ditto 
where there is any real danger of confusing a gl.Vertex2d with any other 
type of Vertex2d. But otherwise, the cleanest and simplest style will be 
best in the long run.

- Brian



  parent reply	other threads:[~2012-08-07  7:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jvddr3$uqm$1@speranza.aioe.org>
2012-08-02  8:50 ` questions on Ada openGL binding in the GLOBE3D packages Egil Høvik
2012-08-02  9:14   ` Nasser M. Abbasi
2012-08-02 10:19     ` Niklas Holsti
2012-08-02 10:46       ` Nasser M. Abbasi
2012-08-02 11:12         ` Egil Høvik
2012-08-02 11:56           ` Georg Bauhaus
2012-08-02 12:12             ` Vasiliy Molostov
2012-08-02 12:01           ` Vasiliy Molostov
2012-08-02 21:12         ` Randy Brukardt
2012-08-02 20:59       ` Randy Brukardt
2012-08-02 12:13     ` Brian Drummond [this message]
2012-08-02 15:01       ` Robert A Duff
2012-08-02 21:18         ` Randy Brukardt
2012-08-02 23:15           ` Robert A Duff
2012-08-02 15:31 ` Pascal Obry
replies disabled

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