What do professionals use?

Started by
13 comments, last by matt_j 18 years, 7 months ago
I want to learn C++ as a hobby. However, I would like to learn the version that professional gamers use to make Commercial quality games (I know my limitations - I just want to learn a little more about how games are created - I am not trying to create the next Half Life or Doom style game). My question is, do professional gaming companies lean towards using C++, or Visual C++? Are they the same? I know Microsoft has a majority in everything, so should I focus my learning on Visual C++? I have started looking at C++ tutorials already, and tried to compile them in Microsoft's free Visual C++ Compiler 2003 (name?), and it wouldn't compile. I had to tweak the code in order to get it to compile correctly (remove the .h in the header file name, add a namespace command, etc.). This is what is now prompting me to decide early on if I should follow C++, or Visual C++. They seem similar (so far to me), but have enough differences that one will not compile correctly based on which version I am using. Which version does professional gaming companies use? Thanks!!
Advertisement
C++ is C++. Visual C++ is just the name of Microsoft's IDE. The language is still C++. Some compilers are more standards-compliant than others, but that shouldn't have an impact on your learning. You should learn C++ and use Visual C++ or DEV-C++ or whatever compiler/IDE you are comfortable with.
I think professionals generally stick to MSVC. But the differences between compilers are pretty trivial. I think that the code you found just wasn't written very well. Good code should (theoretically) be able to compile just fine on any modern compiler.
Thanks for the quick replies. So if I have a book "Sams Teach Yourself Visual C++ in 21 Days", that is the same as learning C++ (just using Microsoft Visual Studio IDE)?
Teach Yourself Visual C++ may include some Visual C++ only programming as well, such as the Microsoft Foundation Classes (MFC) for making Windows programs. Aside from that, yes provided you understand MSVC isn't 100% ANSI compatible. At least, that used to be the case. Maybe it's different with 2003.

If all you want is to learn ANSI C++ and not MFC or take the chance that books which teach a specific compiler/IDE version of it, get a book that states "ANSI C++" on the back cover (or internet description). They're usually cheaper because they're less in demand, and you'll be able to learn just the C++ language.
"I had to tweak the code in order to get it to compile correctly (remove the .h in the header file name, add a namespace command, etc.)."

That's because your code was wrong. The C++ standard (a document that defines what is and what isn't C++) says that the standard header files do not have the .h, this has to do with a historical backwards compatability issue that you need not concern yourself with.
It is always easy to find out whether an executable was compiled with MSVC. Just open it with a hex-editor and if there is the string "Rich" in the first 500 bytes, it was compiled with MSVC.

I rarely come across an executable that wasn't compiled with MSVC, both games and applications.
Thanks for all the help everyone. This board is terrific.

Just to give you an idea of what I did (and where I might have gone wrong) I first decided to download a free C++ compiler when my interest was sparked to learn C++. I decided on Microsoft's and went here to download Microsoft Visual C++ Toolkit 2003:

http://msdn.microsoft.com/visualc/vctoolkit2003/default.aspx?pull=/library/en-us/dv_vstechart/html/vctoolkitcmd.asp

I download the compiler, and tried out the steps to compile this piece of code they supplied:

#include <iostream>
using namespace std;

int main()
{
cout << "Hello World! \n";
return 0;
}

It worked, and ran successfully.

With my new compiler ready to go, I decided to look for an online C++ tutorial. This was my mistake. I am not knocking the following web page, or whoever took the time to make this offering, it just did not work with the compiler I downloaded. I found this site, which offers the below code: http://www.cplusplus.com/doc/tutorial/

#include <iostream.h>

int main ()
{
cout << "Hello World!";
return 0;
}

When I ran this in the compiler I downloaded, I received fatal errors. In order to make this work in the compiler I downloaded, I discovered I needed to remove the .h in the header name, and then add the using namespace std line from the above Microsoft example. Once I did that, it worked.

At this point I decided to stop the online tutorial I found, and seek help from this forum - which worked out well for me. I found all the answers I was looking for, and decided to purchase Ivor Hortons Beginning ANSI C++: The Complete Language book. It has the word ANSI in the title as one poster mentioned, and it received 4 and a half stars from Amazon with over 50 reviews. I ordered the latest edition (3, 2004), and hope to receive it in a few days.

Thanks again for all the responses. You have placed me on the right track.

If anyone has any comments regarding the book I ordered, I would love to hear them. Thanks!! I look forward to coming back to these forums once I start to get in to the book.
Yeah unfortunately that code snippet does not conform to standard C++ and is a mix of C/C++ paradigms. It will be much better (and easier) learning from a book that uses standard C++.
All compilers are not the same. It's not just IDE differences. The differences people will run into however are not important for beginners.

Professionals will use whatever gets the job done well. Quake 3 for instance used visual C++ and is in primarily C (not C++). But I've even seen successful commercial games written in Delphi (Age of Wonders for example). It's up to you to decide what works for you.

This topic is closed to new replies.

Advertisement