Alexander Larsson wrote:
> 
> On Wed, 28 Apr 1999, Ben Hochstedler wrote:
> > If the Undo mechanism could be better accomplished by rewriting Dia in
> > C++, would you give a C++ port your blessing?
> 
> I doubt it would be easier to do in C++. It's just e question of designing
> it and coding a lot.

I completely agree with Ben, and I especially think that C++ helps a lot
in doing the 'correct' design.

> You are of course welcome do do whatever you want with Dia, but i don't
> feel like starting from the beginning, using a language i choose not to
> choose from the start. Although C++ has matured a lot since then i still
> think i would have choosen C, had i started today. Peoples opinion differ,
> such is life.
> 
> > I love using Dia, and I thank you for starting such a cool project.  I'm
> > just a little disapointed it wasn't implemented in an OO language.  I think
> > adding new objects could be done much cleaner, faster, and more efficiently
> > if it was written in C++.
> 
> Well, i don't know. Exactly what would using C++ to derive objects buy
> you, except for some syntactical differences? This is not just a complaint
> against C++, could you try to describe what you think this would buy you
> in the context of Dia.

First, I just helped someone who wants to go step by step towards C++ but for the
time is doing all in C. So I showed him how to implement nice features like
virtual functions (polymorphism) in C. It's quite awkward to do but it's nice to
learn the technical points.

Heaving said that, I think using a language which supports inherently polymorphism
is much more clean and less error prone. The compiler will do much more checking
and you can really concentrate on the design. There are quite a number of *very*
good design patterns which would apply to a project as yours. Visitor would be best
to implement your renderer idea, Memento would be well suited for the undo 
functionality,
etc. It's clear, it's elegant, it's really the way to go when projects start to get
sufficiently complex.

But again, you sure can do that in C. In the beginning, C++ compilers only translated
the source into C for further processing. It's just an incredibly awkward to do.

Stefan
_______________________________________________________

              
Stefan Seefeld
Departement de Physique
Universite de Montreal
email: [EMAIL PROTECTED]


      ...ich hab' noch einen Koffer in Berlin...
_______________________________________________________

Reply via email to