C++ sucks for games

P

Peter Lewerin

(e-mail address removed) (Peter Lewerin) wrote
There is a paradigm
difference between CLOS and non-OOP Lisp code, but the language is the
same, and it's quite possible to mix the two.

D'oh.

I first meant to write approximately "There is a complexity difference
[...] but no paradigm difference.", but then I thought people would
think I didn't understand the proper meaning of 'paradigm' in this
case. So I was going to write "There is a complexity difference
[...], but the language is the same, and it's quite possible to mix
the two." And then 'paradigm' slipped in where 'complexity' should
be.

My point is that CLOS code involves more components and
interconnections: it's a little bit more complicated than straight
non-OOP Lisp code. However, CLOS code is still "Lispy" all the way,
and CLOS code and non-OOP Lisp code work well together. As a simple
example, PRINT, a basic printing function in Lisp, works equally well
with CLOS objects as with non-OOP data.
 
V

Vincent Cantin

C++ is a old gadget library built incrementally from the past, now there is
cleaner OO languages.

IMHO, Java is the language for games starting from now.

CPU are going faster, there is no reasons to not use Java for games.
Java is easy to debug, easy to maintain, easy to port as C++ is, etc ...

Programmers need to involve and try some other languages (not only Java).
 
G

Gerry Quinn

C++ is a old gadget library built incrementally from the past, now there is
cleaner OO languages.

IMHO, Java is the language for games starting from now.

CPU are going faster, there is no reasons to not use Java for games.
Java is easy to debug, easy to maintain, easy to port as C++ is, etc ...

Programmers need to involve and try some other languages (not only Java).

I don't see Java as having any major advantage over C++ for experienced
programmers. And it has some real disadvantages.

I wouldn't be surprised if it gets a run in massively multi-player RPGs
and the like, though. (And of cource it is popular for cellphone
games.)

- Gerry Quinn
 
J

Jeremy J

Vincent Cantin said:
C++ is a old gadget library built incrementally from the past, now there is
cleaner OO languages.

C++ is NOT AN OO LANGUAGE! It supports OO programming, but offers many
more design options. If you exclusively program OO programs then use
java, or smalltalk or an OO language.

Why do people try to sew cloth with spears and kill lions with
needles?

Jeremy J.
 
G

Gerry Quinn

C++ is NOT AN OO LANGUAGE! It supports OO programming, but offers many
more design options. If you exclusively program OO programs then use
java, or smalltalk or an OO language.

That is the argument of people who want to misuse C++, and don't like to
be shown up by those using it properly! C++ was designed to be OO, with
support for exceptional cases as well as legacy C code.
Why do people try to sew cloth with spears and kill lions with
needles?

Whatever kills the lions gets used.

- Gerry Quinn
 
S

Sashank Varma

Gerry Quinn said:
That is the argument of people who want to misuse C++, and don't like to
be shown up by those using it properly!

People like Stroustrup? See:

http://www.research.att.com/~bs/bs_faq.html#Object-Oriented-language
http://www.research.att.com/~bs/bs_faq.html#multiparadigm
http://www.research.att.com/~bs/oopsla.pdf
http://www.research.att.com/~bs/bs_faq.html#advanced
http://www.research.att.com/~bs/bs_faq.html#why

Gerry, you're not a C++ advocate, you're an OOP zealot who
happens to use C++. You use C++ in a more orthodox manner
than Stroustrup himself recommends, and you've demonstrated
a remarkable ability to disregard the new ideas you've been
shown here based on your vague impression of Lisp or Lisp
advocates.
 
B

Bjarne Stroustrup

Gerry Quinn said:
I don't see Java as having any major advantage over C++ for experienced
programmers. And it has some real disadvantages.

I wouldn't be surprised if it gets a run in massively multi-player RPGs
and the like, though. (And of cource it is popular for cellphone
games.)

From http://www.research.att.com/~bs/applications.html:

ZeroC (http://www.zeroc.com/): Provides ICE, a distributed
object-oriented computing infrastructure with a modern C++ mapping.
ICE is written in portable C++ and compiles with a wide range of C++
compilers. ICE is used for massive multi-player games, such as Mutable
Realms' on-line multiplayer role-playing game Wish that allows tens of
thousands simultaneous players in a single game world. The game's core
logic and performance-critical functions are written in C++ using ICE.

-- Bjarne Stroustrup; http://www.research.att.com/~bs
 
P

Phlip

Bjarne said:
From http://www.research.att.com/~bs/applications.html:

ZeroC (http://www.zeroc.com/): Provides ICE, a distributed
object-oriented computing infrastructure with a modern C++ mapping.
ICE is written in portable C++ and compiles with a wide range of C++
compilers. ICE is used for massive multi-player games, such as Mutable
Realms' on-line multiplayer role-playing game Wish that allows tens of
thousands simultaneous players in a single game world. The game's core
logic and performance-critical functions are written in C++ using ICE.

And just today someone at work pointed out Hello Kitty had a massively
multi-player game offering.

I asked, "So can I get into it, grab a machine gun, and hose down HK?"
 
A

Alain Picard

Gerry Quinn said:
C++ was designed to be OO, with
support for exceptional cases as well as legacy C code.

It may have been designed that way, but it failed
miserably. At least according to Alan Kay.
 
G

Gerry Quinn

People like Stroustrup? See:

http://www.research.att.com/~bs/bs_faq.html#Object-Oriented-language
http://www.research.att.com/~bs/bs_faq.html#multiparadigm
http://www.research.att.com/~bs/oopsla.pdf
http://www.research.att.com/~bs/bs_faq.html#advanced
http://www.research.att.com/~bs/bs_faq.html#why

Gerry, you're not a C++ advocate, you're an OOP zealot who
happens to use C++. You use C++ in a more orthodox manner
than Stroustrup himself recommends, and you've demonstrated
a remarkable ability to disregard the new ideas you've been
shown here based on your vague impression of Lisp or Lisp
advocates.

If you read that pdf file, you'll see that Stroustrup uses the term
'multiparadigm language' when struggling for words. He wraps up by
saying: "I have argued that there are - and must be - useful techniques
beyond object-oriented programming and design. However, to avoid being
totally misunderstood, I would like to emphasise that I wouldn't attempt
a serious project using a programming language that didn't at least
support the classical notion of object-oriented programming."

I don't disagree with any of that. What I reject is the notion of those
who latch onto unfortunate terms like 'multiparadigm language', that
object orientation is just one of a number of equally useful and valid
general-purpose approaches to the programming and design of non-niche
software.

- Gerry Quinn
 
J

Jeremy J

I suggest you think before you post, because quite frankly, you are
making a total fool of yourself.
Take a look at the publicly availiable boost libraries (www.boost.org)
for some high quality non-niche professional grade libraries that use
multi-paradigm designs to solve very difficult and complex programming
tasks. If you think that the Boost Graph Library (BGL) could be
written in a 'pure' object oriented language and be taken seriously,
then you should get your head checked.

The BGL was written at the laboratory of scientific computing of Notre
Dame. If you think that Scientific Computing is a niche market, then
you don't know someone with Cancer, or a Genetic Disorder. There is
nothing a-priori that prevents an OO language from being statically
bound, but without the C++ template meta-programming techniques used
by the library , it would (literally) be 100 TIMES SLOWER.
I don't want to wait 100 times longer for a cure for AIDS, or a clean
energy source, or to know the trajectory of an asteriod.

Nothing against OO design, but it is only ONE design solution among
MANY, and anyone who limits themselves to it will is limiting their
options for success.

Jeremy J
 
G

Gerry Quinn

I suggest you think before you post, because quite frankly, you are
making a total fool of yourself.

I suggest you learn not to top post, before you start resorting to
insults because you can't face the truth about your pet language. You
could also try reading the post you respond to.

[What I said]
Take a look at the publicly availiable boost libraries (www.boost.org)
for some high quality non-niche professional grade libraries that use
multi-paradigm designs to solve very difficult and complex programming
tasks. If you think that the Boost Graph Library (BGL) could be
written in a 'pure' object oriented language and be taken seriously,
then you should get your head checked.

I am aware of Boost, and I even mentioned an associated project
previously on this thread. On 1 Nov I said: "Spirit is part of a
library project on the STL level. My view, perhaps controversial, is
that templates are for writing libraries that will see massive re-use.
Day-to-day programming will use such libraries, but day-to-day
programming should not involve writing templates."

The same applies to Boost. Writing STL-level libraries IS a niche
software project. [Frankly, I think it attracts more people than its
usefulness deserves - it attracts people who program for programming's
sake, who believe algorithms are everything, who produce over-complex
'clever' solutions to problems that people have long learned to bypass.
A tiny fraction of Boost, including perhaps the graph library, may get
in STL eventually, and some of it will even see serious use thereafter.
But even if it sees as much general use as the important parts of STL
such as sorting and collections, it will still be niche software.]

In short, if you think I'm saying generic programming is not useful for
making STL extensions, you are misreading me. What I'm saying is that
there are no paradigms that are "[compared to OO] equally useful and
valid general-purpose approaches to the programming and design of non-
niche software".
The BGL was written at the laboratory of scientific computing of Notre
Dame. If you think that Scientific Computing is a niche market, then
you don't know someone with Cancer, or a Genetic Disorder. There is
nothing a-priori that prevents an OO language from being statically
bound, but without the C++ template meta-programming techniques used
by the library , it would (literally) be 100 TIMES SLOWER.
I don't want to wait 100 times longer for a cure for AIDS, or a clean
energy source, or to know the trajectory of an asteriod.

"Software is written in a university" does not imply "this software will
cure AIDS". As for your 100X, we will discuss that another time if you
like - let me note only that the only overhead necessary for a graph
library written without generic programming is the overhead of copying
your graph into the appropriate format for the library to use - and it
might well be MORE optimised once that is done. In software, there's
always more than one way to skin a cat.
Nothing against OO design, but it is only ONE design solution among
MANY, and anyone who limits themselves to it will is limiting their
options for success.

Your attitude as expressed in the first part of that sentence is exactly
what I am disagreeing with, despite the fact that the last clause is
perfectly correct. There are cases when other approaches are better,
but that does not mean the other approaches should be considered as
having equal status in general.

- Gerry Quinn
 
R

Rene de Visser

What I'm saying is that
there are no paradigms that are "[compared to OO] equally useful and
valid general-purpose approaches to the programming and design of non-
niche software".

So your absolutely sure that nothing has ever or will come along that will
be better than OO (and you probably mean a particular type of OO) that will
ever be better?

I now that what your saying above is not as strong as this, but there are a
lot of paradigms developed in the last 40 years that not many people are
aware of.

Or do you mean just from paradigms that the majority of programmers know?

Why do you believe this? Or even a watered down version of this?

Why do you believe that OO can't be improved, surpassed or augmented?

What aspects of OO can't be improved upon?
In what ways is OO unsurpassable?

Rene.
 
J

Jeremy J

I am aware of Boost, and I even mentioned an associated project
previously on this thread. On 1 Nov I said: "Spirit is part of a
library project on the STL level. My view, perhaps controversial, is
that templates are for writing libraries that will see massive re-use.
Day-to-day programming will use such libraries, but day-to-day
programming should not involve writing templates."

I don't see why not. Perhaps they are too complex? Most applications
of templates are rather simple and well defined. No doubt C++ meta
programming requires great care (mostly because of poor compiler
support), but if you want/need compile time resolution, I see few
other options in the programming world.
The same applies to Boost. Writing STL-level libraries IS a niche
software project. [Frankly, I think it attracts more people than its
usefulness deserves - it attracts people who program for programming's
sake, who believe algorithms are everything, who produce over-complex
'clever' solutions to problems that people have long learned to bypass.
A tiny fraction of Boost, including perhaps the graph library, may get
in STL eventually, and some of it will even see serious use thereafter.
But even if it sees as much general use as the important parts of STL
such as sorting and collections, it will still be niche software.]

I don't care who is attracted to a library. I judge it on it's
usefulness, ease, and efficiency.
In short, if you think I'm saying generic programming is not useful for
making STL extensions, you are misreading me. What I'm saying is that
there are no paradigms that are "[compared to OO] equally useful and
valid general-purpose approaches to the programming and design of non-
niche software".

I am beginning to see what you think is niche software. I disagree.
"Software is written in a university" does not imply "this software will
cure AIDS". As for your 100X, we will discuss that another time if you
like - let me note only that the only overhead necessary for a graph
library written without generic programming is the overhead of copying
your graph into the appropriate format for the library to use - and it
might well be MORE optimised once that is done. In software, there's
always more than one way to skin a cat.

That 100 x is compared to dynamic runtime methods, and if you think
that converting 500 gigs or more of data to an appropriate format is
easy buisiness, then you are mistaken. Remember that you may be forced
to convert data for each library that you use. There can be huge
performance losses if you want to make use of one algorithm and have
to convert all your data there and back.

I have not even mentioned the development time saved by using a
library such as BGL (as opposed to writing a custom library or
retrofitting your data to one).
Your attitude as expressed in the first part of that sentence is exactly
what I am disagreeing with, despite the fact that the last clause is
perfectly correct. There are cases when other approaches are better,
but that does not mean the other approaches should be considered as
having equal status in general.

I am not sure what you mean by "equal status". In general most
problems will be solved well with OO principles. But by skewing your
perspective to automatically assume that OO is the best design
a-priori, then you miss out on many other opportunities. If two or
more design methodologies seem equaly applicable to a design problem,
I would choose OO because it is well understood, and well supported.
But often design methedologies are not equaly applicable, and I have
the sense to recognize when OO would be an inferior (or superior)
design option.

If you are saying that OO is the dominant and best understood design
methedology today, you are correct. If you mean that trying to
retrofit clever designs onto problems that would best be solved with
simple, well defined OO design is stupid, then there is no
disagreement. But where we diverge is that you beleive that OO design
suits all non-niche projects. Since niche has not really been defined,
we will have to agree to disagree. I personally see scientific
computing as very mainstream, and deserves more attention to design
issues than games or web browsers.

I don't think you are wrong Gerry, I just think you are 'blinded by
the light' and take your OO advocacy so far that you fail to see there
are other ways to write successful (non-niche) software.

Jeremy J
 
K

Kenneth Tilton

Gerry Quinn said:
In short, if you think I'm saying generic programming is not useful for
making STL extensions, you are misreading me. What I'm saying is that
there are no paradigms that are "[compared to OO] equally useful and
valid general-purpose approaches to the programming and design of non-
niche software".

Functional reactive programming is the silver bullet OO wanted to be
(and it even makes OO better):

http://www.haskell.org/frp/
http://www-sop.inria.fr/meije/esterel/esterel-eng.html
http://www.tilton-technology.com/cells_top.html

:)

kenny
 
G

Gerry Quinn

What I'm saying is that
there are no paradigms that are "[compared to OO] equally useful and
valid general-purpose approaches to the programming and design of non-
niche software".

So your absolutely sure that nothing has ever or will come along that will
be better than OO (and you probably mean a particular type of OO) that will
ever be better?

I think anything that supersedes OO will build on OO, rather than
replace it.

- Gerry Quinn
 
G

Gerry Quinn

I don't see why not. Perhaps they are too complex? Most applications
of templates are rather simple and well defined. No doubt C++ meta
programming requires great care (mostly because of poor compiler
support), but if you want/need compile time resolution, I see few
other options in the programming world.

I simply think that because of the complexity and obscurity of such
code, the win from templates only kicks in when massive reuse is
expected, and that would rarely apply at an individual project level.
In short, if you think I'm saying generic programming is not useful for
making STL extensions, you are misreading me. What I'm saying is that
there are no paradigms that are "[compared to OO] equally useful and
valid general-purpose approaches to the programming and design of non-
niche software".

I am beginning to see what you think is niche software. I disagree.

Well, that is a matter of words.
That 100 x is compared to dynamic runtime methods, and if you think
that converting 500 gigs or more of data to an appropriate format is
easy buisiness, then you are mistaken. Remember that you may be forced
to convert data for each library that you use. There can be huge
performance losses if you want to make use of one algorithm and have
to convert all your data there and back.

Converting a graph with 500GB of graph node data to another format might
take some time, but on the other hand I would not be expecting the
functions of Boost Graph Library to be returning anytime soon from
operations on such a graph ;-)
I am not sure what you mean by "equal status". In general most
problems will be solved well with OO principles. But by skewing your
perspective to automatically assume that OO is the best design
a-priori, then you miss out on many other opportunities. If two or
more design methodologies seem equaly applicable to a design problem,
I would choose OO because it is well understood, and well supported.
But often design methedologies are not equaly applicable, and I have
the sense to recognize when OO would be an inferior (or superior)
design option.

If you are saying that OO is the dominant and best understood design
methedology today, you are correct. If you mean that trying to
retrofit clever designs onto problems that would best be solved with
simple, well defined OO design is stupid, then there is no
disagreement. But where we diverge is that you beleive that OO design
suits all non-niche projects. Since niche has not really been defined,
we will have to agree to disagree. I personally see scientific
computing as very mainstream, and deserves more attention to design
issues than games or web browsers.

I don't think you are wrong Gerry, I just think you are 'blinded by
the light' and take your OO advocacy so far that you fail to see there
are other ways to write successful (non-niche) software.

I think perhaps we are not as far apart on the spectrum as we appear,
albeit we are not in the same place either...

- Gerry Quinn
 
G

Gerry Quinn

Gerry Quinn said:
In short, if you think I'm saying generic programming is not useful for
making STL extensions, you are misreading me. What I'm saying is that
there are no paradigms that are "[compared to OO] equally useful and
valid general-purpose approaches to the programming and design of non-
niche software".

http://www.sgi.com/tech/stl/drdobbs-interview.html

That was 1995, and he hoped to find such a paradigm. Did he?

- Gerry Quinn
 
G

Gerry Quinn

Gerry Quinn said:
In short, if you think I'm saying generic programming is not useful for
making STL extensions, you are misreading me. What I'm saying is that
there are no paradigms that are "[compared to OO] equally useful and
valid general-purpose approaches to the programming and design of non-
niche software".

Functional reactive programming is the silver bullet OO wanted to be
(and it even makes OO better):

http://www.haskell.org/frp/
http://www-sop.inria.fr/meije/esterel/esterel-eng.html
http://www.tilton-technology.com/cells_top.html

I hope your work on frp proves useful. But I'll believe it's the silver
bullet when I see it...

- Gerry Quinn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top