Is C dying?

1)Is C dying?
2)Can you find job in the game community only with C knowledge and OpenGL?
3)Why more and more games are using DX instead of OpenGL?
Since I am new to game development I am asking these questions so that I have a grasp of reality.

Looking at desktop applications then you’ll see that C is used less frequently than C++ (or C#, for as much as it’s being used). But dying? no!
C is often used in embedded applications and speed-critical applications. C,s advantage over C++ is still that it’s a bit faster due to less overhead of the objects.

Well, I’ve never come into contact with the gameindustry, i’m merely a student, but from what I’ve read is that more and more games are using C++. The advantages of OO design are often greater that the disadvantages.
Learning C++ would be a good move, so I have been told.

I have no experience with DirectX, but I think it’s because most games are aimed to work under Windows, not cross-platform. I think I read somewhere that OGL is losing terrain to DirectX technology-wise, but don’t quote me on that as I’m not sure.

  1. It may be loosing, but not dying. C is still a very good language for low-level programming, microcontrollers for example.

  2. No answer from me here, not enough experience on the topic. But I would be surprised if the answer is no.

  3. Do you really mean to compare DirectX, a full feature multimedia library containing components for graphics, sound, music, input, network, with a pure graphics API? It’s pretty obviuos why DirectX is more used that OpenGL; it has WAY more features. Games that uses OpenGL also, generally, uses DirectX for stuff that OpenGL does’t provide, like input and sound.

C,s advantage over C++ is still that it’s a bit faster due to less overhead of the objects.

What kind of overhead?

As far as I know objects are still managed in the compiled code by an object manager. Also can the construction and destruction of objects be hard on a system.
Ofcourse, you won’t notice on your AMD XP<insert big number>+ or P4 but when working on embedded systems with processors with a few Mhz and little RAM you don’t want a lot of useless overhead that are brought in by a object manager and object overhead. In such a case every byte counts

I have codede C++ for quite some time, and I have never heard of any “object manager”. And if there is, there is one in C too, cause I have never seen any (major) difference in machine code compiled from similar C and C++ code.

As for constructors and destructors, if you need the same functionality in C, you will get the same performance hit when calling your own function to initialize and deinitialize an object. Say you need all new object to be initialized. In C++, you use a constructor. In C, you use a regular function (or a macro, or whatever). In the end, the result is the same, a function call to initialize the object. If you don’t need to initialize an object, there’s no reason to implement a complex contructor either.

The difference in speed between C and C++ is not the language itself, but the way you use it. It is possible to write slow code in C++, and it’s also possible to write slow code in C. It just depends on how you use it.

Hey Antony,

  1. No C isn’t dying at all. A lot of people use C on this forum and in jobs that involve programming drivers or many low level things.

  2. I have no idea about this one! By like Bob said, I’d be really shocked if the answer was no. With specifically game programming, it may be kinda hard. But if you are just looking for graphics programming, it is a possibility to find a job using C and OpenGL. I’m a college student so this is all speculation!

  3. Well, DX is an API made to program games. It has it’s own model support & it has parts for sound, input, etc. OpenGL only provides the most basic procedure you need plus a few useful ones in the utility library. DirectX provides users everything they need to start making a game.

  • Halcyon

well if you are going it alone and money is a big startup concern know that opengl works just swell with mingw and the mingw C compiler is much faster than the c++ compiler. Also, a lot of the advantages of c++ deal with working in groups(usually large) and 500,000+ line programs. C has a bit less stuff to learn. But if you are worried about a job just think of the fact that TONS of development houses use 3D Studio Max when there are definately(no one here can argue about this because this is a fact) better modelers out there. Why do they use it? Because that is what everyone in the field knows. There are a lot more 3d studio max uses than Maya. So with programming its kind of the same deal. If you want a job follow the herd, because the herd will be the ones hiring you.

  1. learn C++ not C
  2. learn DirectX
    But if you are DIY C and Opengl are what i use.

To Bob -

I agree with you completely that the preformance of C++ as compared to C completely depends on your intelligent use of the language, but from my experience there is an additional overhead that is always there in C++ if you’re taking advantage of the features of the language that give it its boost over C. This may be a negligible overhead in the case of modern PCs, but with many embedded devices you’re much more limited in all areas… in cases like this I do believe it may make a difference to use C over C++.

If your extremely knowledgeable about C but know nothing about C++ consider this: all the knowledge of C can be applied in C++. C++ is just C with oop elements such as templates and classes and inheritance. The majority of the code is still C based.

On 01-13-2003 03:04 AM, a Contributor named Antony made the following remark:
1)Is C dying?

No, C is not dying, and it is not going to die any time soon. If all you know is C, then C++ should be easy to pick up…though I learned 'em both the other way around. I’ve seen people within my own projects that only know C or Java who are able to pick up the elements in C++ just as easily as you should be able to. The only horse that deserves to die right now is C#.

On 01-13-2003 03:04 AM, a Contributor named Antony made the following remark:
2)Can you find job in the game community only with C knowledge and OpenGL?

No, not in Nebraska, where I live grin

On 01-13-2003 03:04 AM, a Contributor named Antony made the following remark:
3)Why more and more games are using DX instead of OpenGL?

I don’t know if the above statement is true or not, but if it is, then why are more and more games being ported to Mac/*nix? Of course you can get by in this industry by knowing C/C++ and OpenGL. It’s the ability to adapt to any API and environment that employers desire.

As far as your last question is concerned more games are using Direct3D IMO because of one thing. OpenGL was designed to be a cross platform 3D general purpose API. Direct3D was designed for Windows games. DirectX can talk multimedia all they want but DirectX was designed for games. OpenGL can be used for games but that’s not what it was designed for. Consequently you will never see Lightwave or 3DS Max written in Direct3D, they use OpenGL.

The creators of OpenGL are aware that DirectX is “leaving” OpenGL behind and will try to address some of it’s more critical issues (namely a fully programmable GPU which DirectX provides). Sure you can use the GL_VERTEX_PROGRAM extension with OpenGL 1.4 but it doesn’t give you the full blown control over the GPU that Direct3D does. OpenGL 2.0 when it is finalized and released will IMO give OpenGL an equal footing with Direct3D once again.

And as always I will finish all my OpenGL vs Direct3D debates with this one word. . . Carmack. John Carmack’s engines have proven beyond all shadow of any doubt that OpenGL can be used to create top notch games. His “shaders” technology alone (which was done without the oh so crucial pixel and vertex shaders) is impressive enough and has stood the test of time. OpenGL can be used to make commercial quality great games. . . it’s just that more developers aren’t using it.

whew that was a mouthful.

[This message has been edited by atimes (edited 01-16-2003).]

>>> Consequently you will never see Lightwave or 3DS Max written in Direct3D, they use OpenGL.<<<

I dont know about Lightwave, but 3DSmax can use any of the graphics APIs it supports: Heidi, OpenGL, Direct3D.

By default, it uses OpenGL of course.

You’re asking why the number of games using DX increasing while those using GL arent?
Because most people are followers and they follow MS. They will never port anything to other platforms.

Originally posted by MrShoe:
If your extremely knowledgeable about C but know nothing about C++ consider this: all the knowledge of C can be applied in C++. C++ is just C with oop elements such as templates and classes and inheritance. The majority of the code is still C based.

MrShoe, I’m sorry, but saying C++ is just C with oop… etc, is like saying United States is just Antartica with houses, businesses, different weather patterns… I think you get the point.

Is C dying??? In an esoteric sense (whatever esoteric means )- yes it is dying.

Do I frequently see C++ that uses no oop, all c structs, and functions- but uses some of the benefits of C++ like stl- all the time.

Originally posted by rpxmaster:
If all you know is C, then C++ should be easy to pick up…though I learned 'em
both the other way around. I’ve seen people within my own projects that only know C or Java who are able to pick up the elements in
C++ just as easily as you should be able to. The only horse that deserves to die right now is C#.

rpxmaster, picking up c++ by just knowing c isn’t by any means easy. Maybe if you know both java and c, you can pick up c++ on your own, but not by knowing just c!

C++ consists of over 7000 rule sets expanding from oop to stl. C consists of something like 700 rule sets??? Somewhere in that range.

If you thing that any C’er can just pick up a book and easily learn everything ranging from inhertance, to operator overloading to polymorphism and stl easily, then you probably don’t know c++. C++ is far more complex than c, allowing for far greater flexibility, and much less tedious coding and debugging.

C is dying out because it can be too tedious to code and debug. OOP is more of an artform, and more based on design, which allows coders to really think out the process of writing out their projects, saving a lot of time in coding. And the mechanics of OOP allows for much easier debugging and software upgrading than procedural programming.

MrShoe, I’m sorry, but saying C++ is just C with oop… etc, is like saying United States is just Antartica with houses, businesses, different weather patterns… I think you get the point.

Actually the United States are just like Iraq, only with H-Bombs :wink:

Yes, C is dying.

Sure you can find a job in the game industry with just C and OpenGL. But if you know C++ inside out (read Scott Meyer’s books before you bother applying for a job!) you’ll find one a lot easier that pays more and is closer to where you want to live.

You basically can’t make windows game without DirectX. Quake[n] use DirectX. DirectX is DirectSound, DirectPlay, DirectInput, Direct3D, etc.

Previously D3D really sucked. Now its API is much better so there isn’t a big reason to use OpenGL over D3D. Especially with DX8 level cards that support PS1.1 programs. They don’t have anything like that for OpenGL. There is fragment_program_ARB, but that is more like PS2.0…

On 01-19-2003 12:34 PM, a Contributor named Terrance made the following remark:
rpxmaster, picking up c++ by just knowing c isn’t by any means easy. Maybe if you know both java and c, you can pick up c++ on your own, but not by knowing just c!

C++ consists of over 7000 rule sets expanding from oop to stl. C consists of something like 700 rule sets??? Somewhere in that range.

If you thing that any C’er can just pick up a book and easily learn everything ranging from inhertance, to operator overloading to polymorphism and stl easily, then you probably don’t know c++. C++ is far more complex than c, allowing for far greater flexibility, and much less tedious coding and debugging.

C is dying out because it can be too tedious to code and debug. OOP is more of an artform, and more based on design, which allows coders to really think out the process of writing out their projects, saving a lot of time in coding. And the mechanics of OOP allows for much easier debugging and software upgrading than procedural programming.

Obviously, you’ve misunderstood me…therefore, I should explain this a little more thoroughly for you. I don’t know where you got the idea of learning C++ from a book, because that’s not what I meant. I learned both C and C++ a loooong time ago back in college :slight_smile: I do know about inheritance, operator overloading, polymorphism, and the Standard Template Library, and I do use them whenever I feel it’s convenient to.

Sometimes, I do forget what kind of inexperienced audience the Beginners board does attract. I myself am trying to believe you registered today just to post that last reply grin http://www.opengl.org/discussion_boards/cgi_directory/ubbmisc.cgi?action=getbio&UserName=Terrance

Other than that, I did want to point one thing out about my last post, where the last sentence read: “It’s the ability to adapt to any API and environment that employers desire.” What I mean is there is a point of experience in developing where it doesn’t matter if you’ve used something previously or not, that you should be able to pick it up easily. Granted, I don’t have any experience in using DirectX, though I can use it just fine if I wanted to. In case you didn’t know, there’s actually a field in college that is intended to ultimately get programmers to this point. It’s called Computer Science.

For those who think C is dying, C itself is still far from dead, in my opinion. It doesn’t matter if you personally like it or not, because there are others that still find a purpose for it. Unfortunately, COBOL is still floating around out there, and that dinosaur has to die first before C can ever be laid to rest.
http://tuxedo.org/jargon/html/entry/C.html http://tuxedo.org/jargon/html/entry/C++.html

Oh well…that’s all I wanted to say. Thanks :slight_smile:

P.S. Correct me if I’m wrong, but I believe ‘esoteric’ is another way of saying ‘community knowledge,’ guys :slight_smile:

No, C is not dying.

You now Linux ( linux kernel ) is in C just for first. C is the basis of C++. Learn C and opp and you will now C++. CG is C based not C++ based ( and CG is new ). Learn C can force you to learn algorithms and made you a bether programmer. If you now the basis there was no gaps in your profiler, and you can understand new languages more easily. Give a look at the top professionals and you will see that they start with C and use C and C++. Give a look at Quake II souce code, pure C code.

P.S: Sorry abou my english.

Oh, and let us not forget what you can do in C that C++ does not allow, such as…

…Math with enums! You can just imagine the endless possibilities, guys:

TRUE - TRUE == FALSE
APPLE + BANANA == GRAPE
MALE + FEMALE + FEMALE == uhh…