[GRASS-dev] GRASS-TNG

"Sören Gebbert" soerengebbert at gmx.de
Wed Feb 21 23:09:00 EST 2007


Hi,

-------- Original-Nachricht --------
Datum: Wed, 21 Feb 2007 17:06:05 -0500
Von: Frank Warmerdam <warmerdam at pobox.com>
An: "Sören Gebbert" <soerengebbert at gmx.de>
CC: Trevor Wiens <twiens at interbaun.com>, grass-dev at grass.itc.it
Betreff: Re: [GRASS-dev] GRASS-TNG

> Sören Gebbert wrote:
> >> For example, on your site, you suggest that C++ be used because it is
> >> the standard for "modern" development. The reality is, if you want
> >> speed and memory efficiency, well coded plain C wins every time. If you
> >> want to do GUI development, then C or C++ is probably not necessary for
> >> most tasks, so some Python based solution is more appropriate. For core
> >> libraries plain C is likely the best choice. Choosing a tool because it
> >> is "modern" rather than because it is the best tool for the job, is not
> >> logical.
> > 
> > I disagree. Because C is a subset of C++
> > you are able to combine object orientated approaches with speed.
> > Many fast libraries and applications are written in C++. And they chosed
> > C++ not because its a modern language, they chosed C++ because it was 
> > the best choice for the project. And this includes not only GUI projects
> > like:
> > * FLTK, wxWidgets or Qt
> > It includes also libraries and programms which need to run as fast 
> > possible:
> > * most game graphic engines: eg. ogre!
> > * visualization libraries: VTK, Open Inventor, OpenSceneGraph ...
> > * gdal, ogr, proj.4
> > ...
> > 
> > And in my humble opinion: an object orientated approach is the best
> > choice for a GIS. Because every point on earth has the same property:
> > Coordiantes in space and time and all kind of attribute data. Those 
> > points can be represented as raster or voxel cells, vector point, lines 
> > ... and so on. And with an objectoriented approach based on this 
> > principle you can create a very sophisticated GIS core.
> 
> Sören,
> 
> I'd just like to point out that PROJ.4 is C, not C++.  I'd also point out

Sorry, i was confused. Next time i will inform me bevor i post.

> that GDAL and OGR took quite a conservative approach to the use of C++
> features, and even at that have suffered substantially due to the
> fragility
> of C++ ABI's, and the difficulty of calling C++ functions from other
> languages.
> 
> Libraries such as FDO and GEOS that I would claim make agressive use of
> modern C++ features have caused me substantial amounts of personal pain.
> 
> My point being, that a C callable interface can be more stable and
> flexible
> for a library than a C++ interface.  I'd also stress that object oriented
> abstraction can be achieved in C or with conservative use of C++.

It can be, of course. Well, my experience with Qt and especially VTK pointed me a way how to code a clean, stable and flexible interface with C++. 
And since i work with VTK and Qt, it is sometimes 
a pain for me implementing my ideas with C.
No inheritance, no templates, no classes, no this pointer, no constructor and so on.
The kind of abstraction i prefer is much easier to code with a real object oriented language. 
Sure object oriented abstraction can be 
emulated in C with void pointer, macros, function pointer and so on,
but this approach is in my eyes ugly. And its much more complicated to
code and debug. Beginner will have a lot of problems to understand such code. I took recently a look at several libraries which uses 
OO design (inheritance, member functions and so on) in C, to get some
inspiration how to implement my ideas better with C. 
But i was disappointed how
complicated basic things like classes, member functions 
and inheritance are implemented.

As you can see, i made some good experiences with C++. :)

I would love to use D as programming language, but its a 
new language and not widely used or supported. 

Just my two cents

Best regards
Soeren


> 
> As for GRASS TNG I think it is presumptuous to use this name for a project
> that originated with a single individual with limited support from the
> GRASS community.
> 
> Best regards,
> 
> -- 
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | President OSGeo, http://osgeo.org

-- 
"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: www.gmx.net/de/go/mailfooter/promail-out




More information about the grass-dev mailing list