Connecting Tech Pros Worldwide Help | Site Map

Still Using C++?

 
Old June 27th, 2008, 05:38 PM
None
Guest
 
Posts: n/a
Hi,

I am a game developer, sometimes "indy" and sometimes for a small-sized
company. I can't speak for all game developers, but everywhere I've ever
seen people working on games, execution speed has always been the most
important constraint in writing code. Writing readable and maintainable
code is important, but takes a back seat to execution speed.

I work with DirectX and/or OpenGL, always in C++. There are plenty of
things that I'd like to see improved in C++. But as far as I have seen,
C++ continues to be the workhorse of the gaming business. I've noticed, as
I was searching for examples of how to do some particular trick in D3D, a
few samples written in C#.

But what I know about C# is two things: 1) managed code, and 2) garbage
collection. These are both deal breakers for execution speed, in my
opinion. Trying to squeeze the maximum number of triangles and shaders
through the graphics pipe using code running on a virtual machine seems...
well, silly. And as for garbage collection, I've found that any serious 3D
code I've written has needed very explicit control over when things are
allocated and deleted. Rendering 3D invloves lots of very large buffers of
data, many of them changing drastically in size (meaning possible
reallocation) between every frame. Minimizing the expense of
allocation/deletion/reallocation through intelligent code is crucial.

Anyway, it just seems like C++ has been the "big hammer" for game
development for long enough that we've figured out what's good and what's
bad about it. I certainly have my own fairly long list of annoyances, but
I'm not really interested in opening that can of worms here, since it's
already been debated to death.

But I am interested in looking for alternatives. Am I wrong about C# -- is
it a viable alternative for serious programming, or is it a toy? How about
"D? "I've heard good things about it, but I don't know how widely
supported it is. Having well-supported tool chanins, libraries, IDEs,
documentation, and other resources is important.

Just wondering...
  #51  
Old June 27th, 2008, 05:41 PM
=?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=
Guest
 
Posts: n/a

re: Still Using C++?


On 2008-04-30 08:30, Razii wrote:
Quote:
On Wed, 30 Apr 2008 13:39:13 +1200, Ian Collins <ian-news@hotmail.com>
wrote:
>
Quote:
>>Nonsense, how many device drivers or system libraries have you written?
>
I don't have to write any. I know people who do and they have the same
opinion. A few days ago I saw a video where the guy claimed that C is
far simpler, cleaner and better to write operating system kernels and
device drivers, and C++ brings unnecessary complexity for such
programming tasks.
Obviously his knowledge of C++ is not as good as it should be. You can
easily write C-style C++ and still benefit from some of the features of
C++, such as the stronger type-checking and function overloading. All
feature in C++ might not be suitable for lowlevel programming, but they
you simply don't use them.

--
Erik Wikström
  #52  
Old June 27th, 2008, 05:41 PM
Chris Thomasson
Guest
 
Posts: n/a

re: Still Using C++?


"Bo Persson" <bop@gmb.dkwrote in message
news:67r918F2ptba7U1@mid.individual.net...
Quote:
Razii wrote:
Quote:
>On Wed, 30 Apr 2008 13:39:13 +1200, Ian Collins
><ian-news@hotmail.comwrote:
>>
Quote:
>>Nonsense, how many device drivers or system libraries have you
>>written?
>>
>I don't have to write any. I know people who do and they have the
>same opinion. A few days ago I saw a video where the guy claimed
>that C is far simpler, cleaner and better to write operating system
>kernels and device drivers, and C++ brings unnecessary complexity
>for such programming tasks. I have to find the link again. In any
>case, C works best for lower level programming. C++ is not needed
>for such programming tasks. That's not my opinion but opinion of
>many others who do write device drivers and kernels.
>
Interfacing to the OS might be slightly simpler in C, as the API is often
published as a C style interface.
>
That some guys claim that they don't need C++ features, could also mean
that these hardcode C coders haven't yet realized what they could use it
for. Is that a language problem?
You can use C++ in the kernel, I would just avoid supporting exceptions and
global constructors/destructors. You could check this out:

http://netlab.ru.is/exception/LinuxCXX.shtml

prototype Linux Kernel in C++, humm.

  #53  
Old June 27th, 2008, 05:41 PM
Razii
Guest
 
Posts: n/a

re: Still Using C++?


On Wed, 30 Apr 2008 21:54:37 GMT, Erik Wikström
<Erik-wikstrom@telia.comwrote:
Quote:
>Obviously his knowledge of C++ is not as good as it should be. You can
>easily write C-style C++ and still benefit from some of the features of
>C++, such as the stronger type-checking and function overloading. All
>feature in C++ might not be suitable for lowlevel programming, but they
>you simply don't use them.
He was experienced low level programmer and was being interviewed. Let
me see if I can find the video again.



  #54  
Old June 27th, 2008, 05:42 PM
Gernot Frisch
Guest
 
Posts: n/a

re: Still Using C++?


a few samples written in C#.

The main reason, IMO, is, that Microsoft is trying to force programmers to
C# with the XNA kit, which allows you to make games for the X-Box 360.
This is a very kind offer from Microsoft, but it will make you create code
you can hardly port to any other platform then.

So, I'll stick with C++ as there's no real benefit from any other language
for me.

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: People still using Tkinter? Chuckk Hubbard answers 3 June 27th, 2008 05:24 PM
People still using Tkinter? Kenneth McDonald answers 11 June 27th, 2008 05:24 PM
Typed DataSet: "Cannot get value because it is DBNull": Why still using it? DraguVaso answers 6 November 21st, 2005 07:38 PM
Typed DataSet: "Cannot get value because it is DBNull": Why still using it? DraguVaso answers 5 July 22nd, 2005 01:10 AM
why are people still using classic classes? Simon Wittber answers 16 July 18th, 2005 09:18 PM