Difference between C++ and VC++?

This is a discussion on Difference between C++ and VC++? within the C++ Programming forums, part of the General Programming Boards category; Hello there, this is my first post... and I need to make it clear I'm a complete layman in regards ...

Difference between C++ and VC++?

Hello there, this is my first post... and I need to make it clear I'm a complete layman in regards to programming. However, I have a keen desire to learn and so that is why I'm here!

My first question... what are the differences between C++ and VC++? I wasn't originally aware of any difference, but I have a good friend who's a professional programmer and he told me that actually, they are different - with "using namespace" being an example of one of the differences (apparently it's only used in VC++: a syntax change or something) Also, apparently VC++ doesn't compile to machine code, but rather MSIL.

I'm really confused, I originally wanted to learn C++ to write my own games, but now I'm at a loss! The tutorial found on this website or any other I've encountered doesn't mention any contrasts between the two - and uses the command "using namespace".

I don't actually know where this question is going ha ha, I suppose I'm trying to ask, should I find a "pure" C++ compiler, and learn to use that instead? What would a professional computer game company use? One thing my friend said was VC++ is good for learning OO progamming - (which I still don't fully understand, along with many other things!).

using namespace is completely standard C++. The basic idea: C++ is a language, VC++ is a compiler for that language made by Microsoft. There will be compiler extensions (bits that a compiler accepts that aren't part of the language) for just about any compiler (gcc has its extensions, VC++ has its extensions). "using namespace" isn't one of them.

I have no idea about the exact process VC++ uses. I wouldn't expect MSIL to be part of the compilation process for C++ (maybe for C#), but it could happen I suppose.

VC++ is Microsoft Visual Studio that will allow you to program in C++, but it is NOT a good learning platform just from seeing what it can do, you will need to learn normal C++ first, so that something like Visual Studio would enhance your abilities and not prevent you from knowing how to program.

C++ is a language.
Visual C++ is a specific compiler for the C++ language.

"using namespace" is part of the C++ language.

VC++ compiles to machine code.

Ha ha, he gave up smoking a while back...

But anyway, after speaking to my friend again, and finding out some stuff on the internet, actually they ARE different. As one person said:

"So if you want to learn C++, you have two choices: Learn C++/CLI, which limits you to a MS-only language which yes, generates MSIL instead of native machine code, and requires .NET to run, and generally isn't worth the bother because if you're going to take a dependency on .NET anyway, why not write in C#?"

Also, bearing in mind C++ is 20+ years-old, and so before OO, and therefore before namespaces.

Anyway, I seem to have found what I was looking for, but thanks for the help.

"So if you want to learn C++, you have two choices: Learn C++/CLI, which limits you to a MS-only language which yes, generates MSIL instead of native machine code, and requires .NET to run, and generally isn't worth the bother because if you're going to take a dependency on .NET anyway, why not write in C#?"

C++/CLI is your VC++. And then, for that matter, what was your second choice?

EDIT: Found the original here. And I think that's a pretty good answer.

EDIT EDIT: I was ignoring the bit about namespaces, because anyone who actually believes what you typed is beyond saving, but for the record: no C++ is not "before namespaces".

But anyway, after speaking to my friend again, and finding out some stuff on the internet, actually they ARE different. As one person said:

"So if you want to learn C++, you have two choices: Learn C++/CLI, which limits you to a MS-only language which yes, generates MSIL instead of native machine code, and requires .NET to run

You need to make up your mind whether you are talking about "VC++" or C++/CLI The trouble is that "VC++" is not very specific: maybe you're talking about a Microsoft compiler for C++ (MSVC), or maybe you're talking about C++ with MSVC specific language extensions, or as it turns out... maybe you're talking about C++/CLI.

Originally Posted by #include Jack

Also, bearing in mind C++ is 20+ years-old, and so before OO, and therefore before namespaces.

It is true that C++ is more than two decades old. It is also true that namespaces were only introduced maybe a decade after the first C++ implementation. However, as has been stated, namespaces are part of standard C++. Furthermore, the statement that C++ was invented before OO is obviously false. There is also the implication that namespaces are a consequence of OO: such an implication is also false.

But anyway, after speaking to my friend again, and finding out some stuff on the internet, actually they ARE different. As one person said:

"So if you want to learn C++, you have two choices: Learn C++/CLI, which limits you to a MS-only language which yes, generates MSIL instead of native machine code, and requires .NET to run, and generally isn't worth the bother because if you're going to take a dependency on .NET anyway, why not write in C#?"

Also, bearing in mind C++ is 20+ years-old, and so before OO, and therefore before namespaces.

Anyway, I seem to have found what I was looking for, but thanks for the help.

No program I've ever written with VC++ has ever needed .NET to be installed.
You can tell it to write MSIL code instead of machine code, but I always compile to machine code.

I don't know if namespaces were part of the original (pre-standard) C++ compiler, but they're definitely in the C++ standard. As for it being before OO, I'm pretty sure even the pre-standard C++ had classes, otherwise it would just be C.

But just for the record: C++ isn't an OO language as it is known today.

No, C++ is an OO language. Modern C++ makes use of "multi-paradigm programming", and OO is certainly one of the programming paradigms involved.

Originally Posted by #include Jack

More is the question of when it is appropriate to use VC++, and why professional programmers in general seem to avoid the VC++ compiler.

Until you have defined what exactly you mean by "VC++", this "question" is futile. Furthermore, I was not aware that "professional programmers in general seem to avoid the VC++ compiler".

Originally Posted by #include Jack

But as no one seems able to answer my original question

That is not very fair: your original question is not well specified, because as I said, "VC++" is not well defined. If you mean to compare standard C++ to C++ with Microsoft compiler extensions, then we certainly can help you (though I wonder how much good that will do when you do not even know C++ in the first place).

I suppose the fault lies with me - it's very difficult for someone just starting to program to grasp the different concepts of C++ as there seems to be no set definitive - I'm probably making generalisations. From what I'm aware of, the original C++ wasn't OO in the sense that modern C++ is. It was not possible to write a pure OO program with it.

As for VC++, I am simply referring to, as you put it, Microsoft's compiler extensions; the Visual Express compilers. When I said professional programmers seem to avoid it, I meant it in the sense VC++ compiles down to MSIL, or parts of it anyway - and so programmers wanting to use .NET would choose C# over VC++.

I was being a bit sarcastic with my last remark. I think I should change my question to - what is best for a novice programmer wanting to learn sound principles and disciplines. Where should I start?

Again, VC++ is usually the "name" of the Microsoft C++ compiler. That is, a compiler for C++, not C++/CLI, not VB, not C#, etc. Pure 100% C++.
Modern C++ has evolved a lot since its original implementation, of course, but I don't see what that to do with anything. Modern C++ is a very powerful OOP language, among other things. You won't find much you can in other languages that you cannot do in C++.

And the last question is still too vague for us to answer (given your initial question). What exactly do you want to do? Do you want to learn a specific language? Do you want to know what the best language is for a given task? That should be the first thing to answer.

I suppose the fault lies with me - it's very difficult for someone just starting to program to grasp the different concepts of C++ as there seems to be no set definitive

No problem.

Originally Posted by #include Jack

From what I'm aware of, the original C++ wasn't OO in the sense that modern C++ is. It was not possible to write a pure OO program with it.

This depends on what you mean by "pure OO". OOP can be used even in C, which does not have any native support for inheritance and polymorphism. Yet, as far as I know, inheritance and polymorphism support was provided from the earliest versions of C++, so in that sense it has always been possible "to write a pure OO program with it".

Originally Posted by #include Jack

As for VC++, I am simply referring to, as you put it, Microsoft's compiler extensions; the Visual Express compilers. When I said professional programmers seem to avoid it, I meant it in the sense VC++ compiles down to MSIL, or parts of it anyway - and so programmers wanting to use .NET would choose C# over VC++.

You might want to read Stroustrup's answer to the FAQ What do you think of C++/CLI? Now, the compiler extensions that I was talking about are those that are of a much smaller scale: they add just a few language features, and the resulting program would not be compiled to MSIL. C++/CLI involves extending C++ on a much larger scale. Either way, there is a common base of standard C++.

Originally Posted by #include Jack

I think I should change my question to - what is best for a novice programmer wanting to learn sound principles and disciplines. Where should I start?

Personally, I would suggest that you start by learning Python, and then use Python to develop programming problem solving skills. On the other hand, if you are interested in learning C++, then I would suggest that you work through Glassborow's You Can Do It! or Koenig and Moo's Accelerated C++: you would learn standard C++ this way, and again use it to develop programming problem solving skills. If you want to pick up C++/CLI later, this foundation would be beneficial, while not constraining you to something too specific.

Ultimately, it is not just about learning a programming language, but about learning how to program to solve problems (which includes things like learning about data structures and algorithms). I would not be so concerned about the nitty gritty details of language and paradigm differences before you start; once you have something, you can acquire another.

And again, VC++ CAN compile to MSIL or it can compile to machine code; it just depends on what compiler settings you use.

Honestly, I think it's better to separate that claim into languages.
C++ compiles to native code. Period. VC++ is the compiler for C++.
C++/CLI (another language) compiles to MSIL. Period. Another compiler in the Visual Studio toolset does this compilation. Regardless if it's the same "compiler", they're still two different languages, so no mere "setting" changes this behavior. The setting switches languages.