Ahh C or C++
I just bought 2 books of C a while ago, and recently 2 books on C++. I was told that you don''t need to learn C to program games in DirectX / Opengl, and that it was all C++. Now that I''m reading first few pages on Windows Programming and Direct X books, it says that everything used is in C and some C++ for classes.
HEADACHE!!!!!!
Can someone verify something with me. What programming language should I learn to program games in Direct X / OpenGL
I got a really big headache now
(people with experience can just say which one because I got books on both)
Make the pain stop!
C and C++ are very similar, it wouldn''t hurt to gain a understanding of both of the languages.
I would suggest learning both, but I would concentrate on C++
Good luck
http://mercuryeffects.com
Good luck
http://mercuryeffects.com
October 10, 2002 12:04 AM
C++ of course, because Object-Oriented software is word of the day and you can''t do that in C. If somebody say that C is better to DirectX/OpenGL, he will be right, but if you can do C++, you can do C. Sorry my bad english, hope you get the idea
It is really up to you. If you find it easier to program using a procedural programming style, go with C. If you prefer to programming using object oriented techniques, then C++ is the language to use. When it comes to large projects, it can be a whole lot easier to manage your code using an OOP language. For something small, OOP might be overkill. A language like C can get the job done quickly. It really depends on what you prefer, and what you are working on. For learning purposes, I would go with C.
---
What i think.
Everything that is done in C is usable in C++, if u learn C++ then u should understand C codes. So my advice is: Go for C++,all the rest is not a problem.
Everything that is done in C is usable in C++, if u learn C++ then u should understand C codes. So my advice is: Go for C++,all the rest is not a problem.
"...and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces."----------Scott Meyers, "Effective C++"
quote: Original post by ThomasSauder
I was told that you don''t need to learn C to program games in DirectX / Opengl, and that it was all C++.
Whoever told you that, he is wrong. C and C++ are closely and strongly integrated. Learning one without the other is a suicide. C and C++ are NOT COMPLETELY different languages. They are about 90% similar. That''s why those books say: "everything in here is written in C. We''ll apply C++ classes in Chapter such and such to simplify the programming task."
Basically, C++ is C with classes. Learn both. Quite painful, but you''ll see it''s very useful.
My compiler generates one error message: "does not compile."
My compiler generates one error message: "does not compile."
You can do Object Orientation in C but C++ make it easy to do so. C isn't known for Object Orientation because the C language wasn't designed for it. However C++ was designed with Object Orientation in mind. Also there are many advancement to C++ over C. The reason for the similarities is that C is the subset of C++ but there is far more to C++ than just Classes.
[edited by - Neverwinter on October 11, 2002 9:18:52 AM]
[edited by - Neverwinter on October 11, 2002 9:18:52 AM]
quote: Original post by nicho_tedja
Original post by ThomasSauder
I was told that you don't need to learn C to program games in DirectX / Opengl, and that it was all C++.
Whoever told you that, he is wrong. C and C++ are closely and strongly integrated. Learning one without the other is a suicide. C and C++ are NOT COMPLETELY different languages. They are about 90% similar. That's why those books say: "everything in here is written in C. We'll apply C++ classes in Chapter such and such to simplify the programming task."
Basically, C++ is C with classes. Learn both. Quite painful, but you'll see it's very useful.
So in a like manner you cannot do addition without knowing naive set theory. I will venture to the point of stating that learning C before C++ will put you at a disadvantage because you get set in the procedural programming paradigm. C++ isn't merely 'C with classes' it features a whole new programming paradigm, object-oriented programming, over C. So learning C++ without learning C is perfectly fine, and probably even advisable today. (not that you shouldn't learn it at all, but you don't need to make it your first language).
Now, second of all learning two languages at once - particularly featuring two different programming paradigms applied in the standard libraries - is just silly. You will mix up the two languages as, yes, there are differences, including syntactical (declarative) ones that won't naturally make sense to a beginning programmer. So, nicho_tedja, please discard the notion that you need to learn both.
Now, to return to the original question, DirectX is a C++ class library and as such cannot be used without a C++ compiler[1]. OpenGL, however, is a C API library, but it can be used with both C and C++, so my suggestion would be to learn C++.
But (they always have to come, don't they), I think you should pack away your notions of doing fancy graphics programming until you have a decent grasp on the language... C++ is not a trivial language and it will take you some time to learn to use. Trying to use complex graphics libraries without knowing the basics of the programming language is even more suicide than learning two language at once. :o)
Hope that clarifies some things.
Yours truly,
Henrik Stuart
[1]: Technically you can actually use it with some C compilers using a special compiler hack utilising the way that vtables are structured, but nevermind that, it's not how it should be done!
[edited by - muer on October 11, 2002 10:27:12 AM]
--I am not a church numeral, I'm a free variable!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement