[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The future of C/C++



Benjamin J Cummings wrote:
> 
> On Wed, 17 Jan 2001, Achilles wrote:
> 
> >       He then went on talking about new projects using primarily Java,
> > stating that the language was still very slow, regarding performance,
> > but that it would soon change, suggesting that C/C++ were near an "end".
> 
> This does seem to be the feeling around my university, too.  However, i
> think this is a bit of an exaggeration.  I think what's happening now is
> more a diversification of lanugages, rather than a full replacement.  I
> could be wrong, anyway.

The trouble is that people who work in Universities are generally totally
cut off from the realities of working in the computing business.  The
practicalities of a programming language are FAR more important than the
theoretical nicities.

When C came out, Pascal and Modula were *far* "better" languages from a
theoretical perspective.  However, C lets you get down and dirty - you can
use it for writing low level device drivers as well as AI programs.

> >       I'd like to know your opinion about this: what do you think? Is Java
> > really going to replace C/C++, once it solves it's performance problems?
> > Is it stupid to start new projects today using C/C++ rather than other
> 
> Lets pretend, for a moment, that C++ is dying.  What's the problem with
> developing in it?  All the toolkits are still written for C and C++, so
> you won't have a support issue in the near future.  The quality of the
> compilers isn't going to deterierate as fewer people use them, so what's
> the problem?  If you were so inclined and you had the libraries, you could
> write a game inc COBOL, if it were your cup of tea.

Yes - exactly.  It takes 10 or 20 years for a computer language to die.

There are some serious problems with the DESIGN of Java that make it
utterly unsuitable to many of the jobs that C++ does - even if there
were a native and well-optimised compiler for it.

One such problem (and there are many) is that JAVA implementation MUST
do
garbage collection.  That's fine for non-time-critical applications like
interactive-ish web pages...but try using it for some hard realtime application.
Garbage collection is an unpredictable consumer of time.  Your program runs
along nicely at an acceptable frame rate allocating and deallocating memory
and then suddenly *KAPOW* the garbage collector kicks in and eats 100 milliseconds
of your CPU time.

If you are writing something like a hydraulic motion platform for a flight
simulator, the jolt that could cause would be enough to do a half million
dollars of damage.

The *beauty* of C and C++ is that they NEVER, EVER do anything sneaky behind
your back.  From just looking at the code you get a pretty good idea of how
much time it's going to take.  That's critical for realtime and heavily
interactive things like computer games.

JAVA is great for what it was designed for - it's hopeless for realtime work
though...even if it did compile and run 'native'.

-- 
Steve Baker   HomeEmail: <sjbaker1@airmail.net>
              WorkEmail: <sjbaker@link.com>
              HomePage : http://web2.airmail.net/sjbaker1
              Projects : http://plib.sourceforge.net
                         http://tuxaqfh.sourceforge.net
                         http://tuxkart.sourceforge.net
                         http://prettypoly.sourceforge.net
                         http://freeglut.sourceforge.net



---------------------------------------------------------------------
To unsubscribe, e-mail: linuxgames-unsubscribe@sunsite.dk
For additional commands, e-mail: linuxgames-help@sunsite.dk