What is C++ good for?
-
Friday, October 02, 2009 3:40 AMI think it's kind of weird that Microsoft can't build a class designer that displays manged types in C++. Why is it that C++ always comes last out of all of the languages! I know it isn't the most popular language but still, you begin to feel like Microsoft are trying to shut it off so there are only 2 languages, C# and VB. Over the years I have learned to program in C++ because of the pointer functionality and the sense of control you have over your code. Where as in C# you know less about what pointers and memory are doing and as a result it makes it easier to program in C#.But then it begs the question what is C++ really good for at the end of the day. There is less and less functionality for it and it's language with many syntax obstacles compared to the easy and quick ways of writing C# code.I would really appreciate different sides of the debate because then it might help me to realize that learning all about C++ wasn't such a waste of time after all.Thanks in advance
- Edited by Palm.Tree Friday, October 02, 2009 4:41 AM Misunderstanding of scentence
All Replies
-
Friday, October 02, 2009 4:04 AMTrue generic programming (.NET's generics don't cut it). Lower memory footprint. Real cross-platform support. Fewer runtime dependencies. Significantly better support libraries (boost and TBB are amazing).
My 2¢ anyway. -
Friday, October 02, 2009 4:06 AM
Quote>But then it begs the question ...
<pet peeve mode on>
http://en.wikipedia.org/wiki/Begging_the_question
<pet peeve mode off>
Quote>... what is C++ really good for ...
http://www.research.att.com/~bs/bs_faq.html
- Wayne -
Friday, October 02, 2009 5:53 AM
The size of a program that shows a form with something on it:
is ~40 Kbytes in C++, using Win32 API
is ~400Kbytes in Borland/Delphi, using Win32 API
is > 10 Mbytes in Java because you need the JRE (same aplies to .Net because you need the Framework)
Regards.
Dev s r'us -
Friday, October 02, 2009 6:05 AMQuote>... what is C++ really good for ...
Go here:
http://go.microsoft.com/?linkid=8310946
and read 1.1
- Wayne -
Friday, October 02, 2009 10:28 AMModeratorSignificant chunks of .NET are written in C++. The CLR is 100% C++ code. The core of WPF is C++ with a layer of C++/CLI on top. GDI+ is 100% C/C++. Whenever you want to extend Java or Python, you have to do so with C/C++ code. Writing device drivers requires using C/C++. Windows is written in C++.
Clearly, C++ is the weapon of choice to conquer the machine. That is however not a common programming task, a dbase app or UI or something webby is far more common. Using C++ for those tasks is a mistake, you'll get the job done much quicker with a managed language.
Hans Passant. -
Friday, October 02, 2009 3:25 PM@nobugz - That post is golden.
The main difference to me is that, with C++, I am free to design and code bottom up, or top down. With the other languages, the API defines the program more than the problem, so I have to do more monkey-wrenching to get work done efficiently. While some of that is ignorance of the various .NET components, I still see a lot of 3rd party activity, like in the heyday of MFC. (If there ever really was, that is....)
Anytime I need to change scope, I can do that easily with C++. It is really quite simple to code your way out of most situations using C++. Adding new interfaces, or gluing dissimilar interfaces is much simpler with C/C++. I also never liked calling my own code "unsafe", either. -
Friday, October 02, 2009 11:16 PMThanks for that reply.Are you saying that if I was to go and write a program that was going to use the .NET framework then I would be best using it in C# or VB rather than C++ because at the moment I write a lot of managed code in C++.
-
Friday, October 02, 2009 11:37 PMModeratorThat's a very different question. C++/CLI is in maintenance mode. It's good for interop with unmanaged code, that's all. VS2010 is going to ship without IntelliSense support for C++/CLI, that's a kiss of death.
Hans Passant. -
Saturday, October 03, 2009 1:23 AMSo I suppose C++ is probably only best for things like writing unmanaged DLLs and cross compiling to other machines.But why is Microsoft making C++ harder to use! Kicking out IntelliSense is a pretty harsh move.Am I right in thinking that Microsoft is trying to shutdown C++ from developers?I thought that a better approach would be to just take the .NET out of C++ which would then return C++'s original uses to Win32 and MFC.If C++ is still a useful language (as the whole Windows Operating System is written in C++) then why get rid of InteliSense. It just seems pointless.
-
Saturday, October 03, 2009 1:35 AMModeratorYou keep switching between different languages. C++ and C++/CLI are *not* the same. Going back to focus on unmanaged C++ is exactly what Microsoft is doing. Only C++/CLI, the managed language, will lose IntelliSense.
Hans Passant. -
Saturday, October 03, 2009 1:47 AMSorry about confusion! I'm one of those developers that doesn't usually read the whole documentation but just gets stuck into it straight away. I get it now anyway. Thanks for all the help Nobugz!
-
Saturday, October 03, 2009 1:54 AM
That's a very different question. C++/CLI is in maintenance mode. It's good for interop with unmanaged code, that's all. VS2010 is going to ship without IntelliSense support for C++/CLI, that's a kiss of death.
This is a really interesting piece of information for all those who read this forum. C++/CLI is being forced to be less functional. Microsoft are trying to make C++ (in general) only for unmanaged code such as MFC and Win32
Hans Passant. -
Saturday, October 03, 2009 4:33 AM
This is a really interesting piece of information for all those who read this forum. C++/CLI is being forced to be less functional. Microsoft are trying to make C++ (in general) only for unmanaged code such as MFC and Win32
Before too much misinformation gets spread, please consider the following comments from MS developers: http://blogs.msdn.com/vcblog/archive/2009/05/27/rebuilding-intellisense.aspx#9656003 and http://blogs.msdn.com/vcblog/archive/2009/05/27/rebuilding-intellisense.aspx#9686760

