Path: chuka.playstation.co.uk!news From: gil@snsys.com (Gil Jaysmith) Newsgroups: scea.yaroze.freetalk Subject: Re: object-oriented support? Date: Mon, 30 Jun 1997 10:29:39 GMT Organization: SN Systems Lines: 45 Message-ID: <5p81kr$fv57@chuka.playstation.co.uk> References: <33b69d9c.138132316@news.scea.sony.com> Reply-To: gil@snsys.com NNTP-Posting-Host: gil.snsys.com X-Newsreader: Forte Free Agent 1.0.82 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.