94

I hear about modern C++ popularity and some talks about migrating back to C++ from C# or other C-like languages.

I know about C++11 features but I would like to hear your experiences, especially from developers who migrated from C# to C++.

More importantly, does Microsoft push developers to use C++? If yes, why?

Telastyn
  • 108,850
  • 29
  • 239
  • 365
Amir Karimi
  • 1,222
  • 1
  • 10
  • 14
  • 16
    I think C++ has always been a more widely used language because it's more well established and easily portable than C#. I don't think it's replacing C#. For windows-based business applications, C# is still going to be in heavy demand as an _easy-to-get-stuff-done-in_ language. C++ never really went away. It just had a sort of resurgence recently. – KChaloux Oct 31 '12 at 13:58
  • 2
    I hope not. Java and C# have been boons to developers and they are still evolving. – Jesse C. Slicer Oct 31 '12 at 14:00
  • 4
    Both C++ and C# are just _tools_: pick the best one for the particular job. e.g. if you want to write cross-platform code, you may want to use C++; if you want small apps that don't require .NET runtime installation you may want to use C++ (with CRT statically linked); if you want to develop some GUI tool for Windows in a RAD way, you may want to use C# and WinForms; etc. – Mr.C64 Oct 31 '12 at 14:15
  • 6
    It's a good question, maybe needs some rewording. It is not another language A vs. language B. Rather, it is specifically what is Microsoft's positions, why did it change and where are they going because the reality is that MS is big enough that when they exert influence at least smaller mountains do tend to move. And yes in this case, they are definitely influencing. – DXM Oct 31 '12 at 15:13
  • Take out the first part of your question, don't make it lang A vs. lang B, just leave the second part :) People have a knee-jerk reaction to close all questions that start with A vs. B – DXM Oct 31 '12 at 15:25
  • 9
    **Let's please keep it civil everyone. Rudeness will not be tolerated.** – maple_shaft Nov 02 '12 at 14:04
  • @A.Karimi - I rolled back your clarification since that made the question very localized was more of a debate/discussion than a question that suits the site. – Telastyn Nov 02 '12 at 15:15
  • For me easy-to-get-stuff-done-in is synonymous with good design, provided it avoids making it easier for some users at the expense of others. C++ replacing C# is not the way round I'd like to see unless C++ has changed dramatically and has also embraced deprecation. – alan2here Nov 24 '12 at 23:11
  • 1
    If going native again (which I can understand), I can't understand why MS is pushing C++, rather than adopting a more modern language like D (which still can use all the C++ libs, AFAIK). – Samuel Lampa Jan 01 '13 at 13:37
  • As I mentioned below, this change in direction has little to do with language superiority. It has everything to do with the the fact that we have reached the upper bound of Moore's law. – bit-twiddler Mar 18 '13 at 18:09
  • It appears the OP is correct. Microsoft is indeed starting to push C++ over managed code for many classes of applications. http://msdn.microsoft.com/en-us/library/vstudio/hh279654.aspx – bit-twiddler Mar 18 '13 at 17:29
  • C# haven't been major or core language of MS. Their core API is always in C/C++, all important apps (VS,Office,DX) are all written in C/C++ (or their own languages) C#/VB is more close to one-time use scripting layer rather than a language for serious(strategic) coding to MS themselves. If MS move on to some new language, it should be something else rather than C#. – Eonil Oct 25 '13 at 17:07

8 Answers8

95

Yes, your suspicions are correct. Microsoft is pushing C++ to come back and become more popular.

I can't find it now, but a while ago I saw a presentation by one of Microsoft big guys and the whole thing was geared towards developers and was about roll out of Windows 8 and especially WinRT (the replacement for .NET framework as well as Win32 API).

He had a timeline that he explained how various pressures were affecting what technology was popular at certain times. So at first people wanted speed so they all coded in C/C++ (two separate languages). As the hardware got faster, the focus moved away from speed of execution and more towards speed of development, so higher level languages became much more popular.

However, now the focus is becoming more towards mobile and ARM-based computers (Windows 8 is first Windows release to be compiled for ARM) and many believe they will become much more popular and for some will completely replace the desktop. So the focus (at least in Microsoft's eyes) is back on C++ because now we care about battery life. Higher level code = more instructions = more juice required.

To support this transition back to C++, they've introduced a completely new Windows 8 programming API, called WinRT (last I checked, that was the name anyway). This API follows the theme of .NET Framework in the scope of functionality it provides but it will be available to anyone coding in C++ (via COM interfaces), in C# or even in Javascript for those that wish to write HTML 5/Javascript apps. They are also bringing XAML (technology used in WPF, their newest UI framework) to be available in C++ as well.

So to me that kind of indicates that there's definitely more focus on C++ at Microsoft than there was in the past.

UPDATE #1:

Since I just got a 'nice answer' badge for this, I thought maybe I should come back and a) clarify few things and b) make the fact-checking police happy because as we all know on technology forums anything inaccurate could result in wars that last for years.

  1. WinRT is not a replacement for .NET framework, but it is yet another alternative that MS Windows developers now have and MS is strongly pushing people to go in that direction. It appears (please hold your flames if this is not 100% accurate) that WinRT was primarily targeted for Modern UI apps although regular desktop apps should be able to take advantage of it as well. Having said this, MS is strongly pushing for people to switch to writing a) modern UI apps and b) start using WinRT so as the balance shifts percentage of people using .NET framework will most likely go down.

  2. C++ will NEVER replace higher level languages such as C# or python. Just like those languages will NEVER replace C++. This was probably the most controversial part of OP's question. But it is all about the balance and the facts are that:

    • C++ community (with MS being large part of it) is pushing for a strong comeback to position C++ as a good language for low-powered devices, whose market share has been going up like crazy lately. If you do not believe me, search for "GoingNative" series of talks that began last year.
    • With all the effort and influence from Microsoft, C++ usage will definitely go up, while C# might drop some what. This is what MS is pushing for and as I said in the comments above, when MS puts their capital behind an idea, they do shift large portion of the industry. I will probably get a response from some guy who will argue, "what industry, I've always been on Linux" and to that my only response is, wake up! Yes, there are other OSs out there but majority of desktop market, both consumer and business at the moment is Windows and any serious developer who wishes to maximize the value of his time would be very silly not to target that chunk of the desktop market.

So in conclusion: Yes, MS is pushing for C++ to come back so most likely its popularity will increase. No, C++ will never replace C#.

Update #2:

I don't know why but technical community tends to see things in very absolute black/white terms when the reality is full of shades of gray. This is a response to several new comments that were added to this post:

  1. .NET framework will not go away any time soon (or ever). Just about every technology that windows had since 90's is still around in some form or fashion. So for those that are so attached to .NET framework: a) don't worry about it disappearing and b) stop arguing in its favor as if your life depended on it, your API is safe.

  2. WinRT does reimplement a lot of functionality that in the past was provided by Win32 and .NET framework APIs. People who want that functionality will have a choice if they want to use WinRT, .NET framework, or continue with Win32 API (that's not dead either). If WinRT doesn't support easy creation of web applications today, there's a very good chance it will support them in the future.

The position that Microsoft announced is that WinRT is a large framework which gave Microsoft a chance to start with a clean slate and built an API using lessons learned in Win32 API and .NET framework itself. I did try looking for that video, and still can't find it, but one of the things the speaker mentioned is that there are certain areas of .NET framework which could have been defined better/simpler/cleaner and WinRT exposes that same functionality in that new cleaner interface.

DXM
  • 19,932
  • 4
  • 55
  • 85
  • 7
    Was it Herb Sutter's talk at C++ and beyond, titled "Why C++?" There's a video of it on Channel 9, although I'm having trouble accessing it at the moment, probably because Redmond is hosting a huge streaming event. Your logic makes sense, but these kinds of statements really need to be backed up with some references, as this would represent a major strategic shift for Microsoft and anyone else who develops software with Microsoft's products. – Robert Harvey Oct 31 '12 at 15:19
  • 1
    @RobertHarvey: This is not my logic. It was straight from that video. I'll see if I can find it a bit later. Supposedly, I'm at work right now :) But yeah, Channel 9 does sound about right. Don't remember the speakers name though. – DXM Oct 31 '12 at 15:24
  • funny how downvotes work. care to leave a comment? is that because I said something inaccurate or simply because your opinion doesn't agree with MS in the first place? I just listed facts from that presentation, nothing here is my own. – DXM Oct 31 '12 at 17:14
  • 2
    @DXM - You are correct and I saw/read the same thing you did. – Rob Oct 31 '12 at 20:27
  • 13
    WinRT is not replacement for .NET. Keep your facts in check please. – Euphoric Oct 31 '12 at 21:27
  • @Euphoric: MFC isn't dead either. We have VS2010 projects that still use that framework. MS has a new "Windows Runtime" and they are putting billions of dollars into it. It's the same runtime consumable from C++, C# and javascript. If they are going to build new and improved things, do you think they will put it in a place where everyone can use them, especially since such place exists, or into .NET framework? I don't stay on top of this stuff too much, but I'm not aware of any new and exciting things coming up in .NET framework 5.0. Is there 5.0? – DXM Oct 31 '12 at 22:10
  • 4
    @Euphoric: In other words .NET framework was never replacement for Win32 API. At the same time, when C# came out many people switched over and forgot all about making C-style function calls into windows DLLs. MS is pushing for same switch now. So yeah, .NET framework will continue to exist under the hood of WinRT and sure you can still use .NET framework, but MS is pushing for people to switch to the new framework. – DXM Oct 31 '12 at 22:13
  • 1
    Most of the examples I've seen seem to be C++/CLI. There seems to be an internal Microsoft struggle between the Core group (C++ developers) and the Developer group (inventors of .NET Framework). This happens in other companies as well. At least they gave us the choice between C++ and C# this time around. – Andrew T Finnell Nov 01 '12 at 12:51
  • 2
    There's no choice anymore - .NET is gone (you can still write C# apps but they will target the WinRT runtime via a .NET-looking wrapper, not the real .NET one), but MS wants you to go native for performance and efficiency. There are several links, but google for "Herb Sutter" and "Going native" and you'll find them all. – gbjbaanb Nov 02 '12 at 13:01
  • 21
    @gbjbaanb - This is 100% false. First ALL .NET ever was was always a very nice wrapper for Win32 library. Second there are only minor differences between the `Full` .NET Profile and 'WinRT' .NET Profile, the major differences, are a great deal of stuff that was poorly implemented 10-15 years ago were removed, and replaced with better designed code. Until they get rid of Win32 library all together .NET is here to stay. Your comment shows a COMPLETE and TOTAL lack of knowlege with regards to .NET and C# language itself. – Ramhound Nov 02 '12 at 13:41
  • 6
    Not to mention that for Web applications, .NET is great. If it were ever a 'replacement', it'd be for desktop apps, and not Web applications. – George Stocker Nov 02 '12 at 15:19
  • 1
    Note that there is a speculation that company politics is partly to blame for this. WinRT is in the Windows division, while .Net is a division of their own. The Windows division are the creators behind COM, MFC, Win32, etc. Some people believe that WinRT is trying to make .Net less popular so that this division gets more praise. I know it's a conspiracy theory, but with Microsoft's whole ranking system for employees, I'd believe crazier things. This could be further backed up by WinRT forcing .Net to use the very leaky abstraction of COM and projections instead of some *real* OO interop method – Earlz Nov 02 '12 at 20:30
  • @Ramhound .. ooh, struck a nerve did I? lol .NET was always a fully managed API and of course it re-used as much of the underlying native code in Windows as it could and WinRT does exactly the same. But on Windows 8, the managed API for C# apps is now WinRT - the same API every other language gets to use, and that API is native. There is no dedicated API for managed languages. So the new big deal is a C# app uses the same API as a JS app or a C++ app. How can that API be called .NET? (and I'm sure there are lots of .NET parts that were added after version 1 that were not win32 wrappers) – gbjbaanb Nov 02 '12 at 23:07
  • Although I actually think Windows 8 is much better for the typical user (not necessarily development though), the adoption rate has been abysmal - I saw one report that claimed it has sold slower than Vista did. If that's the case, and XP and 7 continue to be the norm, I imagine .Net and C# will continue to dominate as well, no matter how hard Microsoft tries to push in the other direction. – Drake Clarris Mar 18 '13 at 12:01
  • No mention of politics in MS. No mention of desire to make iOS devs port apps to Windows. – Den Mar 19 '13 at 09:12
  • To take away some confusion: "Understanding WinRT and Windows 8 for .Net programmers", Hanselminutes July 2012 talk #329 at http://www.hanselminutes.com/329/understanding-winrt-and-windows-8-for-net-programmers – Jan Doggen Mar 19 '13 at 10:01
  • 1
    "Microsoft is pushing C++". Microsoft were pushing it when Steven Sinofsky (WinDiv) was in control but WinRT and Win8 both failed abysmally in the market place and Sinofsky left under a black cloud. Now only the VC++ guys are pushing C++ and that is just because they happen to be shipping an updated version. So I don't think it is reasonable to say "Microsoft is pushing C++" any more. – J D Oct 30 '13 at 15:15
  • 1
    Think this answer needs another update, the latest Microsoft dotnetconf really didn't suggested anything about moving to C++ and has a lot of cool work coming to the .net world. – Thomas Harris Jul 19 '14 at 12:53
  • C# is not higher level language than C++. Nor is python. They are the same 3GL level of abstraction languages. With the main difference that C++ is the best performing of all of them. – There is nothing we can do Dec 29 '15 at 08:34
22

No, Windows 8 is all about using whatever language you need to (or know) get the job done. JavaScript, .Net languages (C#) and C/C++ are all supported equally.

Nothing is being replaced and it's up to developers in the end anyway. There is however a push for better battery life which WinRT makes easier.

The exception is games where C++ is getting more support, especially on Windows Phone 8 while the managed languages have no native support (aka no xna).

Daniel Little
  • 1,402
  • 12
  • 16
  • 1
    +1 Microsoft are desperate to get Windows 8 adopted in the smartphone and tablet market. Apple [make more revenue from iPhone alone](http://m.tuaw.com/2012/09/07/iphone-revenue-greater-than-all-of-microsofts/) than Microsoft do in total. One obstacle is that there are very few apps for Windows phone/tablet compared with the established platforms. So they want to make it possible for anyone to create an app, in their favourite language. C#, C++, or JavaScript. – MarkJ Nov 01 '12 at 06:16
  • I don't know why they decided to drop native c/c++ support starting from windows phone 7. Since that day, windows+windows mobile became from 90% major platform for our company shifted to 10% importance. 10% is only because of best development tools (visual studio), otherwise we don't make anymore products even for windows desktop. – Pavel P Nov 01 '12 at 08:17
  • 1
    @Pavel I'm not sure what you're saying there.. – Daniel Little Nov 01 '12 at 09:13
  • @Pavel -they dropped native code from WinPhone7, then dropped managed code from WinPhone8. Maybe you can re-visit the platform now, or just ignore it until/if it gets a much bigger market share. – gbjbaanb Nov 02 '12 at 13:23
18

I know about C++11 features but I would like to hear your experiences

The thought that people would prefer C++ over C# (or pretty much any other post 1990 [non-php] alterative) for general purpose programming is laughable. C++11 adds some good missing bits, but it's still nailing legs to a dog.

C++ has some good niches, and it's still the best option on some platforms with limited compiler support. But no, modern C++ is nowhere close to replacing anything except perhaps antiquated, broken C++.

Telastyn
  • 108,850
  • 29
  • 239
  • 365
  • 31
    Read what you are writing. You are outright claiming that using C++ for general purpose programming over C# is *laughable*. Is this sincerely a fact you believe in, or is it merely your own exaggerated opinion? – zxcdw Oct 31 '12 at 14:26
  • 38
    @zxcdw - If I have 100 general programming problems, I will get ~90 of them done faster, better, with fewer bugs using C# or Java or Python or Scala or... And that's being generous. This is the common viewpoint of pretty much every professional programmer I know; even the ones who use C++ as their primary language. – Telastyn Oct 31 '12 at 14:40
  • 33
    @zxcdw: I'm a hardcore C++ developer. I've done C++ for 15+ years and worked mostly on back-end apps that need C++. I've been all over STL and half the Boost. Much to dismay of my team I've introduced template metaprogramming in few places that I thought deserved it. Point I'm trying to make is that I love C++ and working with it. Having said that, I agree with Telastyn, if I have a general problem that doesn't require what C++ has to offer, I would rather pick up C# or even Python. They are higher level languages and you simply get things done faster in them. This true at least for Win devs – DXM Oct 31 '12 at 15:22
  • 5
    @MadKeithV - If I weren't working on a C# app that's being run on OSX, iOS and Android, I might give that cross platform argument a little more weight. Even ignoring that, the non-C# languages I listed are almost always better options than C++ when cross-platform is a strong concern. C++11 isn't doing much to push those options away. – Telastyn Oct 31 '12 at 15:35
  • 2
    @Telastyn - hey, didn't know you could do C# on iOS / Android these days, good to know (http://xamarin.com/monotouch). That DOES mean that C# is now an absolutely valid choice for general purpose cross-platform development. – Joris Timmermans Oct 31 '12 at 16:00
  • 2
    A lot of software becomes a soup of projects. Some nonesense JNI containing a C++ .so but making some restful calls to another C# project that really ought to be consolidated, etc. When you take a look at said soup and decide to make it all consistent, C++ is frequently the best, easiest, and fastest way to go. Again, I'm talking about big backend enterprise software here. – MrFox Oct 31 '12 at 17:11
  • 14
    If all you have is a hammer, everything looks like a nail. The improvements in C++11 won't diminish the pervasive impact of C# and other similar, but perhaps more platform agnostic languages, rather it will keep that ship afloat. The biggest selling point of C++11 remains that it can be the end-to-end language for a system that pokes around in the depths of a system, yet offers the opportunity for tinkering around with higher order abstractions. – JustinC Oct 31 '12 at 18:45
  • 4
    I prefer C++ over C# for general purpose programming. Let the laughing commence I suppose. -1 – Ed S. Oct 31 '12 at 20:23
  • 5
    @DXM: I have a similar experience: > 15 years of C++ (C++ is the language I have most experience with) and the only reason I see for using it is execution speed (but I could easily switch Pascal or Ada for that) and some nice libraries it offers (such as Qt). Otherwise I find other languages like Ruby, Scala, or Haskell far more interesting to work with. I think C++ replacing C# would be a step backwards. – Giorgio Oct 31 '12 at 20:26
  • 2
    No clue how hardcore c++ devs with 10 years of experience could chose over c++. Personally, I prefer c++ for most of the tasks. At the same time I don't do that much of gui work and have never even had opportunity to learn c#. Whenever I do anything in bash/perl/php I spend half of time googling for snippets which I don't do when I work with c++. – Pavel P Nov 01 '12 at 08:13
  • 3
    @Pavel, but that shouldn't be used to indicate that one language is better than another. If you spent all day every day writing perl, you'd be googling for c++ snippets all the time. – whatsisname Nov 02 '12 at 15:37
  • 2
    @Pavel: Not to put words in your mouth, but this is how I just read your post: You do not know c# but you don't understand how a C++ developer can choose C# over C++. It's simple. I do not get attached to a specific technology and then go around defending its honor because I happen to be in that camp. I love C++ and come back to it because for the job I do, it is still IMO the best language. Having said that I love exploring other languages and having explored them, I have learned to recognize the value in them. You haven't done that, so in part that's probably why you don't see that value :) – DXM Nov 02 '12 at 23:55
  • @DXM You are right and wrong at the same time. I don't know c# (I barely touched it for automation and plugins in visual studio). But at some points in time perl was my favorite language and I also like php a lot. Still, being primarily a c++ developer, I prefer c++ for most tasks. Reasons I use something other than c++: web programming (I choose obviously php), scripting where I don't want to create compile app I'd use perl (as long as it's not supper simple task that can be done with bash/awk/sed whatever unix spaghetti). Overall, with all of them it's a pain to debug compared to VS debugger – Pavel P Nov 04 '12 at 04:52
  • @Pavel: Or I could be right and right :) I agree with everything you said about those other languages that you did look at. However, you really should give C# a chance and then revisit this discussion in a few months. a) Its roots are from C++ so to a c++ developer, it is very easy to pick up, b) you still use VS debugger and yes, the debugger is powerful, c) it comes with giant framework that takes care of so many things for you that c++ doesn't and d) language being higher level gives you new constructs which would be impossible in c++ (e.g. using reflection for type discovery at runtime) – DXM Nov 04 '12 at 06:42
  • 4
    @Telastyn: It might be a good idea to look for a better workplace. The C++ experts that say C++ is not productive or not the first choice for most tasks are not C++ experts. Really. They probably don't use libraries and still use C like style, with bad overall architecture. – Coder Nov 25 '12 at 19:00
  • 1
    just about anyone who insults C++ is a broke programmer making like 60k a year working in a cube with a lifetime achievement goal of becoming middle manager. bask in your ignorance. In trading business you can make over 1 million a year with C++. – user805547 Dec 30 '12 at 00:46
  • 5
    "In trading business you can make over 1 million a year with C++.": That doesn't make C++ a language it's pleasant to work with. – Giorgio Mar 18 '13 at 12:19
  • 3
    As someone who spent a long time staving off C#.NET and always programming in C++, whenever I try C++ again *now*, I want to cry. C# and the .NET framework is a wondrous combination to behold. Not to mention DLLs are no longer an absolute nightmare. I'm a total convert. If I could program everything in C#, I would. – Nick Bedford Sep 12 '13 at 11:00
  • @Pavel, to throw my pennies into the mix - if you like C++ you might *love* C#. You should give it a real shot and see. I don't have 10+ years of experience and rarely use low-level languages (use C when I do) but IMHO C++ is MoL a mess and C++x is like putting icing on a poop cake. I used to love it, but like others said I wouldn't use it unless I had a damn good reason to. – ChiefTwoPencils Apr 09 '15 at 20:33
2

DXM wrote:

So the focus (at least in Microsoft's eyes) is back on C++ because now we care about battery life. Higher level code = more instructions = more juice required.

According to this words choosing Java as primary language/framework for Google's Android was a mistake. It was not. Higher level language usually means getting things done faster and I think this is the most important thing to Microsoft and Google. The more and better applications are created for the platform, the higher is profit of the OS producer.

On the other hand there is plenty of software for Windows still written in C++ so pushing those developers to switch to C#/JavaScript/anything else would be insane. Microsoft focus on giving a possibility to develop Win8 apps to as many developers as it is possible that is why in my opinion they decided to support C++ and JavaScript in Win8 development stack.

rotman
  • 141
  • 6
  • 5
    Java was a mistake. If you want raw performance (and you often do) then you want to write in C/C++. If you want developer productivity then you want a higher level language like Python or PHP or Ruby or JS. Java (and C#) are middle-ground systems that give you neither the best performance or the best productivity. As it is, C++ isn't so bad - you can get good productivity from it once you know what you're doing. – gbjbaanb Nov 02 '12 at 13:20
  • 8
    @gbjbaanb I have mixed feelings about your comment: a few years ago, putting Java and C# on the same level of abstraction would have made sense, but the introduction of LINQ, lambda expressions and async programming features in the newer versions of .NET have moved C# to a higher level (Java is going to catch up on the lack of functional programming in JDK8, but that's still in early access stage). – codesparkle Nov 02 '12 at 15:21
  • I so wish I could find that freakin' video. Seems that people are arguing with me whereas all I did was repeat what one of the lead developers at Microsoft told the world. That wasn't my opinion. But just to play devil's advocate, are you convinced that my galaxy S would not have longer battery life had it used more C++ instead of Java? So far I haven't been impressed with that phone's battery life. :) – DXM Nov 02 '12 at 18:11
  • @DXM http://www.alejandrosegovia.net/2011/09/08/herb-sutters-why-c-talk-sum-up/ - but yes, the point is that less CPU usage (and JIT, GC and memory use) equals better battery. I think in generally it matters more on the server than on the phone, and maybe they're talking about the OS services, but when I play Sentinel 3 (on a galaxy S as well), the battery really disappears quickly. Imagine if it was written in Java!! (but I wouldn't play it then as it'd be too slow :) ) – gbjbaanb Nov 02 '12 at 22:32
  • @codesparkle - I have the misfortune to work with WCF services, and looking at the heaps of code and config you have to put in to make a webservice, then compare it to what you have to do in PHP (half a dozen lines of code) then you realise just what's wrong with .NET, then look at how much code or config you have to write for practically everything, you see its got a bit out of hand. Without VS helping mask the problem, you'd never write any C# code again. (go ahead, try coding a webservice using only notepad. You can do it in Python, Ruby, PHP or C++ without too much pain). – gbjbaanb Nov 02 '12 at 22:42
  • 2
    @gbjbaanb fortunately, WCF is only a tiny part of .NET, and generalizing that to apply to the C# language is invalid. Have you actually *used* the new features since .NET 3? Because VS isn't such a great development environment at all (in fact, it's truly annoying without ReSharper). So, considering that this very site (and the whole SE network) is built with C#, your comment seems a little inaccurate. – codesparkle Nov 03 '12 at 00:40
  • @gbjbaanb - Take a look at WebApi. – Amir Karimi Nov 04 '12 at 12:23
  • 1
    @rotman Please do not reply to other people's answers in your own answer. Answers should only address the original question :) – Andres F. Nov 25 '12 at 00:12
  • 6
    @gbjbaanb: I would say that it was assertion without evidence that *middle-ground systems that give you neither the best performance or the best productivity* are a mistake. Given that performance and productivity are **both** important, the best solution is one that balances the two, and a middle-ground choice like Java or C# is an **excellent** choice for many use cases. – Carson63000 Jan 08 '13 at 00:42
  • Visual Studio 2012 is the most advanced IDE, sure ReSharper mades it "better" but I sunk in tons of years in Eclipse, Netbeans, IntelliJ and those are NO picnic. Lets talk about XCode for iphone development Holy cow LIGHT YEARS behind Visual Studio. Every contract I'm at a company working with iphone developers that like the "pay" for iphone development but all the ones who used visual studio were like "Xcode and Objective C is just not thought out at all" – Tom Stickel Oct 10 '13 at 07:00
  • The whole talk of web services, WCF , Web API, ASMX, there are fairly easy way to crank out web services in 10 different ways there is a current pluralsight.com video on this. Java .... Axis and JAX-WS YUCK .... – Tom Stickel Oct 10 '13 at 07:00
  • @DXM: this video? http://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2012/-Not-Your-Father-s-C- – user1284631 Oct 22 '14 at 12:22
  • @codesparkle, doubt you care but I think your opinion of VS is outrageous. Perhaps it's because it was what I first learned on but holly crap are there a ton (nearly every single one I've used) of IDEs out there that would do good by emulating it. What IDE, IYO, is the go to? – ChiefTwoPencils Apr 09 '15 at 20:45
2

C++ still have Header files, flexible preprocessors (#define), ... such stuffs some people considered these features 'evil' or 'difficult to manage'.

C#, on the other hand, use metadata, no need to write and maintain header files.

About Microsoft adding more features to C++: Not a wondering matter.

Every C++ compiler is adding more features, including C++11 features. gcc is also.

linquize
  • 1,150
  • 1
  • 11
  • 20
  • 7
    If all you can say bad about C++ is header files well, you've indirectly proven the point. I can list a whole host of serious C# issues, non-portability, non-deterministic, run-time overhead, proprietary, etc. – user805547 Dec 29 '12 at 19:47
  • 1
    Use the right tool for the right job. C++ is great at companies like Intel for various unmanaged code performance needed low level to the medal projects, but if you need a website / web service which every company DOES, than good luck with C++ for that! – Tom Stickel Oct 10 '13 at 07:04
1

It might just be me, but, I see much more plain C usage than C++.

The fact that C++ has swallowed plain C whole makes it hard to infer who is using what.

But there are vastly more C open source projects than C++.

My view is if you need close to the metal speed use C. If you need flexibility and manageability with reasonable performance use C# or Java. If you want a clean design done quickly use Python, Scala, Groovy or any of a number of fully featured languages.

James Anderson
  • 18,049
  • 1
  • 42
  • 72
  • 2
    No, I think you are wrong here. C++, if you disable exceptions, is as close to the metal as C, as long as you know what you are doing. The problem is ABIs. In C++ the situation has still to be solved, they are working on it. Once this is done, I think there will be not much appeal to use C instead of C++ when in fact C++ has better error checking and is a superset, so the tool would be superior at that point. – Germán Diago Aug 08 '14 at 11:07
0

c++ is not replacing c#. Let us look into where c++ language is used. It is used when there is need for high performance, for writing middleware libraries, low level access, and for writing code for resource constrained devices. Though you can use c# for some of these c++ is more suited for these. Microsoft's push for c++ is highly related its big push into the mobile space. Nobody will ask you to write your next web app in c++. But with Qt, the productivity argument cannot made against c++. But I think a lot of people are not familiar with Qt.

Jaak
  • 39
  • 1
  • C++ is still heavily used in non-vertical commercial Windows software development. – bit-twiddler Mar 18 '13 at 18:26
  • 1
    C++ is like the most professional tool you can use to write software. But you have to be skilled to write good code, since it is quite free and has some quirks do to backwards compatibility. I think it is well suited for all kind of software except scripting, actually. The problem is the learning curve. With modern libraries it is very competent even at productivity. And think that if the app is successful, you must port it. Porting is easier with C/C++ codebases, do to compiler availability. The list of software written in C++ is endless: amazon, google, dropbox, telecom, games, facebook... – Germán Diago Aug 08 '14 at 11:11
-4

No, C++ can't replace C# because all the non-Direct3D Windows Phone 8 apps must be developed with C#. You can't develop and publish applications to wp8 app store just by using C++ or HTML5/Javascript. And as long as Microsoft doesn't remove this restriction, C++ isn't replacing anything. As a result, I am sure very few people will develop for WP8. Poor Nokia, losing one more time.

Here is the excerpt from microsoft dev center:

Windows Phone 8 doesn’t support the XAML UI with C++ code-behind app model that is supported for Windows Store apps.

yet another:

Does this mean that I cannot use C++ with XAML to develop an app on Windows PHone 8, am I restricted to use C# + XAML?

That is correct. XAML can only be used with C#. C++ can be used for a WinRT component used by the C# project.

Even Microsoft MVPs claim that this rumor is a deliberate misinformation made by Microsoft himself:

I love what Microsoft is doing with WinRT and Windows Phone 8, but I wish they wouldn't oversell some of it as it will just frustrate users once they learn the completely truth of the matter.

And this deliberate wrong marketing wastes people's months:

It would have been nice to know this MONTHS AGO, before I went down the all native code route with my Metro app.

Özgür
  • 169
  • 1
  • 5
  • 1
    Your links both state you can use C++ for WP8 development, and it's only XAML which requires C#. Furthermore, Direct3D is only supported by C++. – Lee Nov 24 '12 at 19:13
  • @Lee, can you develop non-Direct3D app without using C# for WP8? – Özgür Nov 24 '12 at 22:50