🔒 Locked
Why Visual C++ ?
Advertisement
Original Post
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.
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).
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).
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!
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!
Quote:
Original post by Diminished
Is there a specific reason to use Visual C++ over any other compiler?
No1.
Quote:
Original post by Diminished
Is there a specific reason to use VisualC++Studio over any othercompilerIDE?
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]
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?
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.
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.
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.
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.
Quote:
Original post by MaulingMonkey Quote:
Original post by Diminished
Is there a specific reason to use Visual C++ over any other compiler?
No1.Quote:
Original post by Diminished
Is there a specific reason to use VisualC++Studio over any othercompilerIDE?
There are good ...
Your first sentence stands in contrast with the corrections you made in the text which you quoted.
Quote:
Original post by Spoonbender
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.
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?
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 have a solution and a project, make sure you add files to the project. Just creating new files with Ctrl-N does not seem to add them to the project by default in VC++ express (is this just a setting I've made somewhere?). So to add files to the project, rightclick on the project in Solution explorer (if it's not visible, you can find it in the View menu), and select Add->New Item. [edit] Changed new file to New Item. Also, if you already have a .cpp file, you can ofcourse use Add->Existing Item, to add it to the project instead, or drag it from Explorer to your project in the solution explorer.
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.
* 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 have a solution and a project, make sure you add files to the project. Just creating new files with Ctrl-N does not seem to add them to the project by default in VC++ express (is this just a setting I've made somewhere?). So to add files to the project, rightclick on the project in Solution explorer (if it's not visible, you can find it in the View menu), and select Add->New Item. [edit] Changed new file to New Item. Also, if you already have a .cpp file, you can ofcourse use Add->Existing Item, to add it to the project instead, or drag it from Explorer to your project in the solution explorer.
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.
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.
Quote: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.
Original post by Diminished
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?
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.
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.
Chad.
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.
Chad.
Quote:
Original post by Daerax Quote:
Original post by MaulingMonkey Quote:
Original post by Diminished
Is there a specific reason to use Visual C++ over any other compiler?
No1.Quote:
Original post by Diminished
Is there a specific reason to use VisualC++Studio over any othercompilerIDE?
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.
Quote:
Original post by DvDmanDT
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 have a solution and a project, make sure you add files to the project. Just creating new files with Ctrl-N does not seem to add them to the project by default in VC++ express (is this just a setting I've made somewhere?). So to add files to the project, rightclick on the project in Solution explorer (if it's not visible, you can find it in the View menu), and select Add->New Item. [edit] Changed new file to New Item. Also, if you already have a .cpp file, you can ofcourse use Add->Existing Item, to add it to the project instead, or drag it from Explorer to your project in the solution explorer.
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.
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.
Quote:
Original post by MaulingMonkey Quote:
Original post by Diminished
Is there a specific reason to use Visual C++ over any other compiler?
No1.Quote:
Original post by Diminished
Is there a specific reason to use VisualC++Studio over any othercompilerIDE?
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?
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.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement