Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Plain old C++ vs C++.NET

 
Riaan Nel
Ranch Hand
Posts: 160
IntelliJ IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prentiss

In the same vein as Gian's question in another thread on this forum - How does plain old C++ (before .NET) compare to C++.NET? Has the .NET framework had a generally positive effect on C++ in terms of things such as execution speed and ease of use? I played around with C++ a couple of years ago, and I'm interested in taking it up again.

When taking (hobby) game programming as an example, I assume that C++.NET will be better suited to the task, as I'm guessing that it has a bunch of useful graphic libraries. On the other hand, when writing applications in which speed is absolutely crucial, will plain old C++ be better? I'm not intimately familiar with .NET, but since it's a Microsoft framework, I'm guessing that C++.NET is a no-no when applications have to be platform independent?

Cheers,
Riaan

Edit: Just for interest's sake; does your book give preference to either C++ or C++.NET?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49466
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can answer some of those questions for you:
C++ 2008 is a .NET language, which adds automatic garbage collection (and a keyword, gcnew and an operator ^ to go with it). It works on a VM, and therefore appears not to have memory locations or pointers. As you suggest, there is a rich built-in library of graphics and windowing classes. It si usual to program C++2008 with Visual Studio, rather than the text editors you can use for C++.

The book is specifically about the .NET version.
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you need a .NET license for it? and cannot use any other editors or compilers?
 
Prentiss Knowlton
Author
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings, Riaan --

As I mentioned in my reply to Gian, C++ 2008 greatly closes the gap that previously existed between C++ and C# or C++ and Java. Because C++ 2008 operates within the .NET framework, it's much easier to create multi-lingual applications, a common underlying intermediate target language of all language compilers that runs on the same virtual machine (much like the Java virtual machine). The downside of this is slower execution time and the upside is automatic memory management and more bullet-proof code owing to powerful debugging and troubleshooting tools.

C++ overcomes the slower execution time when the programmer is willing to let portions of his or her program to be compiled as plain old C++ (native C++ or legacy C) unmanaged code through use of the #pragma unmanaged directive discussed in chapter 19.

Though C++ .NET is currently Windows-centric, I expect that your no-no considerations regarding other platforms will soon be obviated.

The book gives preference to C++ .NET over native C++, as plain old C and C++ information is already readily available in Kernighan and Ritchie's "The C Programming Language" and Stroustrup's "The C++ Programming Language." I was pleased to find that the complete text of both of these books is available online free in PDF format (by consulting the all-knowing Google). For this reason, all the space is devoted to what is new and significant in C++ .NET without spending space describing what is already well known and readily available from other books and sources.

Cheers,
Pren

Riaan Nel wrote:Hi Prentiss

In the same vein as Gian's question in another thread on this forum - How does plain old C++ (before .NET) compare to C++.NET? Has the .NET framework had a generally positive effect on C++ in terms of things such as execution speed and ease of use? I played around with C++ a couple of years ago, and I'm interested in taking it up again.

When taking (hobby) game programming as an example, I assume that C++.NET will be better suited to the task, as I'm guessing that it has a bunch of useful graphic libraries. On the other hand, when writing applications in which speed is absolutely crucial, will plain old C++ be better? I'm not intimately familiar with .NET, but since it's a Microsoft framework, I'm guessing that C++.NET is a no-no when applications have to be platform independent?

Cheers,
Riaan

Edit: Just for interest's sake; does your book give preference to either C++ or C++.NET?
 
Riaan Nel
Ranch Hand
Posts: 160
IntelliJ IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prentiss Knowlton wrote:Greetings, Riaan --

As I mentioned in my reply to Gian, C++ 2008 greatly closes the gap that previously existed between C++ and C# or C++ and Java. Because C++ 2008 operates within the .NET framework, it's much easier to create multi-lingual applications, a common underlying intermediate target language of all language compilers that runs on the same virtual machine (much like the Java virtual machine). The downside of this is slower execution time and the upside is automatic memory management and more bullet-proof code owing to powerful debugging and troubleshooting tools.

C++ overcomes the slower execution time when the programmer is willing to let portions of his or her program to be compiled as plain old C++ (native C++ or legacy C) unmanaged code through use of the #pragma unmanaged directive discussed in chapter 19.

Though C++ .NET is currently Windows-centric, I expect that your no-no considerations regarding other platforms will soon be obviated.

The book gives preference to C++ .NET over native C++, as plain old C and C++ information is already readily available in Kernighan and Ritchie's "The C Programming Language" and Stroustrup's "The C++ Programming Language." I was pleased to find that the complete text of both of these books is available online free in PDF format (by consulting the all-knowing Google). For this reason, all the space is devoted to what is new and significant in C++ .NET without spending space describing what is already well known and readily available from other books and sources.

Cheers,
Pren


Hi Prentiss

Thank you for the reply; it answered a lot of my questions. Also, thanks for the references to the free C++ books. After reading your reply, it makes complete sense that your book gives preference to C++.NET as opposed to native C++; in this industry, one has to keep up with the times.

Campbell, thank you to you too.

Cheers,
Riaan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic