[GRASS5] Want GNU libavl ?
Glynn Clements
glynn.clements at virgin.net
Mon Jan 21 22:50:07 EST 2002
Eric G. Miller wrote:
> > I know that we have this long-standing policy of preferring ANSI C as
> > the central language for GRASS. But the truth is that few people _if
> > any_ today in engineering, research, academia use C as the development
> > language. It is almost universally C++ that is used. I think that we
> > have to accept that now and move on. We don't need to necessarily code
> > the core of GRASS in C++, but we should be able to wrap in external data
> > structures if these are only available (or the best implementations are
> > available ) in C++. Also reflect : Mitab, Dime ... the list goes on.
>
> I think it's mostly a matter of pragmatism. ANSI/ISO C89 works well pretty
> much everywhere. Also, GRASS has a lot of code. Do you want to rewrite
> it all? One problem with C++, it's a one-way street. Sure, you can write
> C that is C++ friendly, but the reverse is difficult. That a lot of other
> folks are primarily using C++ for relatively new projects doesn't have
> a lot of bearing, when you consider maintaining/enhancing an existing
> code base written in C.
As well as agreeing with what Eric said, I'd also like to point out
that binaries generated from C tend to be significantly more portable
than those generated from C++. If a binary requires libstdc++, it
typically requires *exactly the same version* of libstdc++ that was
used to build it. And if you want to use a library which is written in
C++, you typically have to use more-or-less the same version of the
compiler that was used to build the library.
> Well, if I had a choice between C++ and Ada95, I'd probably choose the
> latter. C++ keeps all the dangerous stuff of C and adds new ways to
> shoot yourself in the foot.
Oh yes.
> (and can we please change G_malloc and G_realloc not
> to cast to a char * !! What a pain that is.).
Consider it done.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev
mailing list