[Re: C or C++?]

puissante puissante at lrc.puissante.com
Mon May 30 11:47:00 EDT 2005


Bill Freeman wrote:
...
> 	Allocation and deallocation is actually under your control,
> and can be no more burden than in C.  For example, an local variable
> that is an instance gets created on the stack, just like a C structure
> that is a local variable.  The class itself might have pointers to
> objects that you allocate inside the constructor, but, again, that is
> under your control - if you are the author of the class.  You can also
> override new and delete to allocate from a fast pool, pre-allocating
> your high water mark usage of a class, and making
> allocation/deallocation deterministic for that class.  You would do a
> similar thing for C structures used in the same way.
> 
> 	However, what you say is undoubtedly true of many of the classes
> in the standard library.  And if you're not going to use them, then the
> case for using C++ gets weaker.
> 
> 							Bill

Also, not all parts of the code need be optimized for real-time.

The real issue is, as always, is there a comprehensive *design* done up
front? This should come first before any decisions about any particular
language, operating system, programming methodology, or platform is made.

Once that very necessary first step is done, THEN it will become
glaringly obvious what you need to do and how to implement it with what
languages, etc. It'll all fall "magically" into place, leaving few
avenues open for debate.

I've seen too many projects fail because the design was not done first.
And a good part of my career was spent fixing and rescuing projects on
the brink of failure because design was seen as an afterthought. Yeah,
the money was nice, but wiping up other people's messes was not exactly
what I had in mind for my talents.

I was not going to say anything on this thread because I have a thing
against creating technology whose sole purpose being to take human life
or support means to that end. But I think this issue is general enough
to apply to areas beyond the military.

There is something to be said as well for the "bottom-up" approaches as
well, and on *small projects* I think that could work best in a lot of
cases. But when there is much at stake and millions of dollars to be
spent, a proper design can mean all the difference between a successful
project and yet another sorry reason to "offshore".

-Fred




More information about the gnhlug-discuss mailing list