# Why Visual C++ ?

This topic is 3864 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I'm 16 years old and I've been learning C++ for about a year now. When I first started learning C++ I used a compiler that came with a book I bought, but after consulting a number of programmers on various forums I've always been discouraged on using anything but Visual C++. Is there a specific reason to use Visual C++ over any other compiler? I'm wondering this because compared to other compilers that I have used, Visual C++ is extremely complicated and I believe it is hindering my learning, although I'm willing to take the time to learn to use it I would much rather use another compiler just for the ease of use. Maybe after getting a grasp on the language I could move on to using Visual C++ perhaps for professional quality programs. Also, any recommendation for a Visual C++ tutorial would be appreciated. Sorry if this topic has been explored before.

##### Share on other sites
Its just over-all, better. Comes with everything you need for development. Has a good debugger, and many other helpful features. I remember when i used to use devc++ and debugging was something i never used. In vc++, its incredibly easy to use.

##### Share on other sites
Visual C++ isn't the only IDE* recommended on these boards. Some people recommend Code::Blocks. Personally I like VC++, but you may prefer Code::Blocks if you feel VC++ is overcomplicating everything.

A few people might recommend Eclipse (although that's possibly more suited to Java development simply because that's what it seems to be used for the most). Some might recommend doing everything by hand with a simpler text editor (Scite, TextPad, or whatever) and writing makefiles to control compilation.

When using a debugger though, good IDE integration is very helpful (not essential, but very helpful). VC++ is very good on that point. I don't know what Code::Blocks provides (I assume it integrates with gdb in some way, but I don't know how neatly they work together).

I used to use Dev C++, but as far as I know it hasn't been updated in a long time, and I seem to remember its code completion was quite buggy (this is something that's actually very difficult to do efficiently with C++, I believe - VC++ does a pretty good job of it) - my impression from reading other people's posts is that Code::Blocks beats Dev C++ nowadays.

John B
* Incidentally, this is what you're talking about. VC++ comes with Microsoft's compiler, but that is a separate program which can be used by other tools or through the command line if you want. Most other free C++ IDEs come with the GNU compiler or a variant of it (mingw is a variant that produces Windows executables).

##### Share on other sites
First of all, compiler is just a command line application, that turns your C++ code into binary format, and then linker is used to link those binary file into an executable binary file.

Visual C++ compiler is very good - it conforms to the C++ standard (well, almost, but the things it doesn't have are also missing in most other compilers as well). It has many optimization features - as far as I know, Visual C++ compiler is one of the best at this (I heard that Intel compiler is just as good or even better at optimizing).

Now, when you say compiler, I assume you had IDE (Integrated Development Environment) in mind. Well, Visual C++ is probably the best windows IDE. It's debugging features are way ahead of any other IDE I've ever tried (Borland, CodeBlocks, DevCpp). IntelliSense is indeed intelligent (most IDEs have it, these days, but they just aren't as smart as in VC++).

What I like the most in VC++ is it's solution/project management and project settings management features. You can customize anything, you can even add your own or third party compilers into the build and have a nice configuration window for it as if it was built in!

Basically, I would never switch to any other IDE - VC++ is the best thing in the field, and I don't see any other alternative for it... It isn't that hard to use it too, just get one of your friends (who already worked with it) to explain the basics to you, and the rest you can find out on your own!

##### Share on other sites
Quote:
 Original post by DiminishedIs there a specific reason to use Visual C++ over any other compiler?

No1.
Quote:
 Original post by DiminishedIs there a specific reason to use Visual C++ Studio over any other compiler IDE?

There are good reasons to use Visual C++ over any other specific IDE currently in existance. Because it's simply the best (for C++ at any rate).

The C++ Language, however, is far more complicated than the Visual Studio IDE. And while that IDE is still a bit complex, the alternatives are worse IMO. Instead of having a centralized point of configuration (the IDE) and documentation (MSDN), you instead get to trawl through search queries trying to find the relevant information between multiple, only partially overlapping, sources of support and information.

In the end, it boils down to this fact: Visual Studio lets me spend more time coding than the alternatives. I'll leave my 2¢ at that.

EDIT: [1] The Visual C++ compiler is also pretty kicking and better than many in various ways, but no, sometimes using other compilers makes sense. In fact, I recommend using multiple compilers in many situations, for a variety of reasons.

EDIT: Clarified wording in ¶3

[Edited by - MaulingMonkey on May 21, 2007 1:03:52 AM]

##### Share on other sites
There's only one area where other IDEs beat VC++ IMHO, and that's learning curve.

Once you learn to create projects (Ctrl-Shift-N), and learn how to compile and run (F5 or Ctrl-F5), you'll love it.

##### Share on other sites
Thanks for all of the input guys, I think I might stick with Visual C++ for a little while longer and see if I can get the hang of it. Do you guys know of any helpful tutorials on the web?

##### Share on other sites
I would recommend Visual Studio 2005, or .NET 2003 if you can get hand on them because Visual C++ (probably 6.0 you got) is way crappier. As for learning how to use it, it's pretty easy. The hard part every beginner find difficult is checking the "empty project" checkbox or else you start with a project with files you don't want.

Once there you just have to check the available panes one by one. Note that they differs when you are either normal coding mode or in runtime/debugging.

##### Share on other sites
What about Visual Studio is it that seems too complex?
I find it pretty easy to use (you don't have to use every feature it offers, after all), but maybe I'm just too used to the program to see what it is that's confusing you.

You create a project, you add your files to it, you hit F5 to compile and run. That's about all I can think of that you need to know to use it.

##### Share on other sites
Quote:
Original post by MaulingMonkey
Quote:
 Original post by DiminishedIs there a specific reason to use Visual C++ over any other compiler?

No1.
Quote:
 Original post by DiminishedIs there a specific reason to use Visual C++ Studio over any other compiler IDE?

There are good ...

Your first sentence stands in contrast with the corrections you made in the text which you quoted.

##### Share on other sites
Quote:
 Original post by SpoonbenderWhat about Visual Studio is it that seems too complex?I find it pretty easy to use (you don't have to use every feature it offers, after all), but maybe I'm just too used to the program to see what it is that's confusing you.You create a project, you add your files to it, you hit F5 to compile and run. That's about all I can think of that you need to know to use it.

It's complex because I don't know how to use it. Here's the problem I'm having, I make a new Project, name it, then I make a new file, I then write the code and press F5, and it says it can not find the file. What am I doing wrong?

##### Share on other sites
Some basic tips:
* A Solution is a collection of releated Projects
* A Project is (usually) a program, or a dll.

For a game, you might have one project for your game, and one project for your editor if you have one. Perhaps you have a dll with your engine and/or things that are shared between the game and the editor.

When you create a project in Visual C++, make sure you check the empty project checkbox, and until you know what you are doing, stay away from all CLR projects (use Win32 Console Application if you are developing a console application). Also, an empty project is not the same as a non-empty project with all files removed (those stdafx files have a special meaning, and you must change project settings if you want to remove them).

Once you've created a project with some .cpp file, save it, and try to run it using F5 (or Ctrl-F5 if you don't want it to dissapear immediatly).

If you get errors, look at the bottom of the screen. There, you should see a list of messages, errors and/or warnings. Doubleclicking them will take you to the line with the error.

If your program crashes, run it with F5, and when it crashes, click Break, to get to the line where it crashed. Then hover your mouse over your variables to see their values, and what caused the program to crash. If the value of a pointer is 0xcccccccc (or is it 0xcdcdcdcd?) it means you forgot to initialize it. To quit the program, use Shift-F5 (stop debugging).

If your program behaves weird, and you know about where, you can go to that line and press F9, then run using F5 (you can also do this while the program is running). Your program will then stop at that line, and let you examine all variables and their values to see if anything is wrong. Use F5 to resume execution, F9 on the same line to remove the breakpoint, and F10/F11 to move to the next line.

Use F1 on anything you don't understand to get to the documentation.

##### Share on other sites
Now that you can get the Express Edition of VC++ for free, I don't see why you'd want to use anything else. It's got everything you need, and I've found it a lot easier to use than Dev-C++. You do have to do a little hackery to get it to compile windows native binaries and dlls, I believe, but still, it is free now, and it has a large number of useful features.

##### Share on other sites
Quote:
 Original post by DiminishedHere's the problem I'm having, I make a new Project, name it, then I make a new file, I then write the code and press F5, and it says it can not find the file. What am I doing wrong?
Well, that could certainly be a problem. You don't want to simply "make a new file." You want to add a new file to the project.

If I recall, you right-click on your project, then there should be an option in that context menu to add a new file to the project. Simply going through the menus and selecting "File->New->C++ File" (or whatever) won't add it to the project, and it will, indeed, complain that it can't find it.

Since you've already created a file, you can right-click the project and select the option to add an existing file to the project.

##### Share on other sites
Preferably, I like to use Code::Blocks. It is really simple and smaller then most other IDEs. Not to mention, I compiled the same project using the Microsoft Compiler, then with MingW compiler; I got a smaller exe size using the MingW one.

##### Share on other sites
Visual C++ Express Edition here.

I have used both Code::Blocks and Dev-CPP, and I must say that Visuals way of doing stuff REALLY helps lots of time. Sure it did take me a little bit to get used to the way it does stuff, but in the end: I love it.

It's debugger has helped me out a whole lot in situations where I would have no idea where to begin while using Code::Blocks and Dev-CPP.

You said your getting errors? What kind of errors? Copy and paste the errors here, and I am sure that we can help ya.

##### Share on other sites
Quote:
Original post by Daerax
Quote:
Original post by MaulingMonkey
Quote:
 Original post by DiminishedIs there a specific reason to use Visual C++ over any other compiler?

No1.
Quote:
 Original post by DiminishedIs there a specific reason to use Visual C++ Studio over any other compiler IDE?

There are good ...

Your first sentence stands in contrast with the corrections you made in the text which you quoted.

This contrast was deliberate, to clarify what I was specifically refering to, as it appeared the OP had muddled the distinct terms together (which is fairly common). You can use other compilers with Visual Studio than the core one it ships with. My assertion is that sometimes using other compilers makes sense (I certainly do), but that using other IDEs never makes sense when VS is available.

##### Share on other sites
Quote:

Thanks, this helped a lot. I should of posted here a long time ago, it would of saved me from a lot of heartache. Thanks again everyone.

##### Share on other sites
Quote:
Original post by MaulingMonkey
Quote:
 Original post by DiminishedIs there a specific reason to use Visual C++ over any other compiler?

No1.
Quote:
 Original post by DiminishedIs there a specific reason to use Visual C++ Studio over any other compiler IDE?

There are good reasons to use Visual C++ over any other specific IDE currently in existance. Because it's simply the best (for C++ at any rate).

...

EDIT: [1] The Visual C++ compiler is also pretty kicking and better than many in various ways, but no, sometimes using other compilers makes sense. In fact, I recommend using multiple compilers in many situations, for a variety of reasons.

I am not trying to correct you. Simply that I was confused by your post and need your help in clearing it.
Quote:
 C++ is far more complicated than the Visual Studio IDE....

I am not sure what you mean by this. I am not sure their complexities are commensurable, or did you mean your average C++ command line compiler?

##### Share on other sites
Quote:
Original post by Daerax
Quote:
 C++ is far more complicated than the Visual Studio IDE....

I am not sure what you mean by this. I am not sure their complexities are commensurable, or did you mean your average C++ command line compiler?

I think he meant, that C++ (the language itself) is far more complicated than Visual Studio IDE. Actually, I agree - you can learn how to use an IDE in a few days, and learn the rest of it when you need it. However, to learn C++... Let's just say, that it takes a lot longer than a few days to learn C++ language.

##### Share on other sites
Quote:
 Original post by DiminishedDo you guys know of any helpful tutorials on the web?
Introduction to Debugging (in addition to giving you some excellent general debugging tips) will show you some of the debugging features in the Visual Studio IDE.

##### Share on other sites
Quote:
 Original post by Paulius MaruskaI think he meant, that C++ (the language itself) is far more complicated than Visual Studio IDE.

Yes. I would've said Visual C++ if I meant the compiler. I'll edit my post for further clarity, though.

Quote:
 Actually, I agree - you can learn how to use an IDE in a few days, and learn the rest of it when you need it. However, to learn C++... Let's just say, that it takes a lot longer than a few days to learn C++ language.

Quoted for emphisis.

Quote:
 Original post by DungeI would recommend Visual Studio 2005, or .NET 2003 if you can get hand on them because Visual C++ (probably 6.0 you got) is way crappier.

For clarity: Visual C++ is part of Visual Studio, not distinct product lines.

Microsoft felt the need to just go stir crazy with the terminology mismashing:
e.g. "Visual Studio/C++ 5"'s package contained Visual Studio '97
e.g. "Visual Studio/C++ [.NET] 2005"'s package contains Visual C++ 8.0

But yes, VS6 is a horrible 9 year old prestandard piece of crap. Evidence of it's evil nature:

Hopefully he's using a modern version like we've been assuming :3.

The lexicon of myself and the people I generally know:
C++               :=  The (Standardized) C++ LanguageVisual C++    ___ :=  The Microsoft C++ CompilerVisual Studio ___ :=  The Microsoft IDEVisual ______  6  :=  A Joke

[Edited by - MaulingMonkey on May 21, 2007 2:32:36 AM]

##### Share on other sites

This topic is 3864 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account