Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: Chris Blackwell Newsgroups: scea.yaroze.freetalk Subject: Re: C versus C++ Date: Sun, 18 Jan 1998 00:58:53 -0800 Organization: SCEA News Server Lines: 36 Message-ID: <34C1C44D.D95D81D8@smartt.com> References: <34b54e3d.9156136@news.scea.sony.com> NNTP-Posting-Host: vict-mx0101111.smartt.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.04 [en] (Win95; I) Hi Matt. As promised I am taking a look at this thread, and I'll tell you right off the bat that I won't touch a C vs. C++ argument. For volumous information on this debate I'll refer you to the rec.games.programmer newsgroup where you'll find numerous threads discussing just this topic. You'll find that there is no easy answer. Once again, I'm not interested in getting into a debate, but instead I'll tell you why I choose to program my games in C++ rather than C: 1) C++ provides a framework oriented towards object oriented programming. It makes it easier for me to write my programs in an object oriented manner, as my thinking process maps better to OOP than other methods. Since the much of the new C++ syntax allows me to more simply express OOP practices than C, I choose to use C++. 2) In my practical experience (I have shipped 12 commercial games and tools in my career), and based on data provided by profiling tools, if you are an experienced coder and optimiser there is no practical difference in the speed of code generated from C or C++. Since, to use an old addage, 1% of your code gets run 99% of the time, it is worth it to me to not deal with my percieved inadequacy of the C syntax to speed up things such as UI code. In time critical code I am not usually making function calls or dereferencing non-local variables, so the code generated by C or C++ is virtually identical where it counts. 3) Noting the above, C++ was designed not just as a C with classes, but also as a "better" C in the fact that it has features to protect from some common errors made by C programmers. For quality critical software that must be shipped to the market, any features which help avoid errors are nice. So there you go. I hope this helps you! -Chris Blackwell