Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: "Michael C. Lee, Jr." Newsgroups: scea.yaroze.freetalk Subject: Re: object-oriented support? Date: Thu, 24 Jul 1997 00:22:54 -0700 Organization: SCEA Net Yaroze News Lines: 64 Message-ID: <33D702CE.22A9@hubcap.clemson.edu> References: <33b69d9c.138132316@news.scea.sony.com> <5p81kr$fv57@chuka.playstation.co.uk> NNTP-Posting-Host: pm4-5.innova.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0Gold (Win95; I) Gil Jaysmith wrote: > > jamin1@psu.edu (Jamin Frederick) wrote: > > The obvious reason I've been avoiding C++ is that its > >supposedly not supported, and I'd also like to know why! Is there > >really that much loss of performance, and must games be programmed > >using a large number of global variables (sort of the opposite of > >object-oriented paradigm)? I HAVE been using a large number of global > >variables, but it seems that once the game world starts to become more > >complex, they will become enormously hard to maintain (i.e., having to > >remember what each global variable stands for, for every event in the > >game is not an easy thing to do -- object encapsulation gets rid of > >this problem...). > > It's simple enough to deal with the global-variables problem. Most > global variables are related to some or other aspect of the game and > are thus candidates for class statics. The rest go in a class called > 'Game' which is defined as 'everything required to run a session of > this game' and of which all other classes (sprites, sound queues, > controller options, etc) are members. (Hey. It's an object model. Your > problem is...? :=) > > > Does anyone know the details behind Sony's reasoning, or is > >there really no fair technical reason that C++ and object-oriented > >programming should not be supported? > > Sony hasn't bothered implementing a C++ library because there's a > fluxing standard for its contents; this is the only thing stopping you > from writing games in C++, in that they aren't necessarily portable > via the standard library interface in the way that games written to > use libc are. (Most games are written for PC, PlayStation, and Saturn > simultaneously; the common denominator for libraries is C rather than > C++.) However, there is a fair bit of professional development going > on which uses C++. The Sony Net Yaroze stuff doesn't include the C++ > compiler but you can build it no problem with the standard GNU source > release (that's what we do for the professional developers). > CodeWarrior includes a proprietary C++ compiler; some recondite C++ > features like namespaces appear not to be supported. (But if you're > really in need of namespaces then GNU wouldn't satisfy you either, and > anyway you're not being cautious enough with your linkage > specifications, is my grumbling & contentious personal opinion.) > > Gil Jaysmith > SN Systems Software Ltd, makers of Psy-Q... http://www.snsys.com > Disclaimer: What I say when I post here represents me, not my employers. DONT USE C++!! Too much overhead. Trust me. In school we learned C++ for my data structures and algorithms class. We had a whole test on C++. One section dealt with memory allocation and dealocation. You would be surprised how much of this is taken away with C++. Just write a simple program that calls a few member functions a few times each. Then include something in the constructor or destructor to tell you when a new class is being created. You will see that many times it creates a local object until the member function finishes, then dealocates it on exit. Mucho overhead. It happens a lot more than one would care to admit. The only way to get around this is to make SURE its not pass by value. BIG OVERHEAD!! Use the 'this' and all that jazz as much as necessary if you plan to use c++(not recommended).