C++ is used heavily from everything from Games, VFX programs (modellers, renderers/raytracer, compositors, paint programs), autopilot and control systems (cars, fighters (JSF), SpaceX are using it for their systems on their rockets), database systems, webservers, etc, etc.
There's a reason it is used a lot - in the real world it gets jobs done well by people who know what they're doing with it.
Saying "the world has moved on to Java, C#, etc, etc" is pushing it, given that the base system for many of those things are written in C++ (most of the native JNI stuff is C++, most Javascript compilers/interpreters are C++, many databases (Oracle, MySQL, MongoDB) are written in C++.
You may not like C++, and it might be difficult, and it may have worts, but thousands of people are using it very successfully for things no other language can do to the same degree overall.
I meant something like: other languages have risen in popularity because they are better than C++ for many types of projects.
This claim is clearly false on Mac OS X and X Window platforms, and disputable on Windows, with the increasing share of .NET apps.
Actually it is not.
On OS X tons of programs, and especially the very largest, most popular ones, are in C++ (think: Photoshop and the Creative Suite, MS Office, and lots of Apple's own: Safari (webkit) is C++, Final Cut and Logic are C++, etc. Don't confuse the front-end UI code (Cocoa) with the backend. C++ is a first class language in XCode, and you can mix it with Obj-C as Objective-C++.
On X Window platforms: besides KDE, some of the most important apps are C++, including Firefox, Thunderbird and Open Office.
On Windows there are almost no .NET apps that people actually use --people as end users, as opposed to corporations. Most of the popular stuff, from games, to office suites, to design suites, to browsers, etc are C++.
Why do you ask?
And if he's using Gnome in Linux, most are written in C.
But for Windows apps, commercial apps, cross platform and games, C++ leads by far.
I don't think this is true for everyone. In fact I believe recently we have seen a renaissance of native code. C++ is the number one language for that. Those higher level languages waste a lot of cycles. You pay the warm and fuzzy feeling during development with performance and/or energy.
If I can deliver a first version 2 months before the C++ version gets ready, I'll have two months to optimize market-tested algorithms before you hit the market. I may even have time to rewrite the sensitive parts in C.
If we are talking gadgets with embedded software, you may use a less powerful hardware and offer a cheaper product, but you'll have to amortize higher development costs and deal with a longer time to market.
For many things the world really moved on. C and C++ are still important, just not as important as they were a decade or two ago.
Yeah, the only problem with that logic is that it never happens.
(Except in the server space, where it doesn't matter what language you're using to make your web app, and you can throw more server boxes at it to make it go faster).
1) Very few commercial programs are made with some dynamic language as opposed to C/C++, and none in the fields where performance matters (games, video, multimedia) etc.
2) Some do incorporate a scripting language, but for non critical layers (Lightroom for example uses Lua for its UI scripting, but all image crunching is in C/C++).
3) It's not like time to market matters that much. You're not building Facebook, you're building a desktop app. Chances are a lot more exist in the same section of the market.
4) """For many things the world really moved on.""" --care to give some examples of successful desktop apps not written in C/C++?
I'm sure you'll find 10.
I doubt you'll find 20.
It still makes sense to use C/C++/hand-tuned assembly for high-performance things like game engines, 3D modeling, audio/video processing and so on. While my current OS is written mostly in C, I am old enough to remember (and have used) technically successful OSs written in things like Smalltalk, Lisp, PL/M and Algol.
Like I said, C makes sense for a lot of things. It's just not as important as it was 20 years ago.
People say that, but I don't see it. The Mac App Store has sold millions of apps already. And the iTunes App Store has sold a BILLION native (non browser) mobile apps.
If you only need is "a browser and a text editor" good for you. I need: a media player, a text editor, a word processor, an IDE, a chat client, Evernote, Dropbox, Skitch, Photoshop, VMWare Fusion, and some other stuff besides...
It all depends on where you look at. I can't remember the last corporate software piece I saw being delivered as a desktop application.
Stand-alone software for iOS has one advantage over web applications in that users sometimes face lack of connectivity. The Facebook app, IIRC, is delivered as a standalone app, but, in reality, is nothing but a web application. It's not alone and there are definite advantages to their approach. Most software appears to be entertainment - games, social thingies etc. They are the kind of games one would expect to be delivered as a Flash application within a brorser on a desktop.
I am not familiar enough with the Mac App Store, but, while there are some more "serious" offerings, in line with the desktop apps I mentioned, most of them appear to be, again, games and other entertainment related stuff. That and front-ends to net-centric applications such as Evernote.
What's "magic" about structs of function pointers? This is a classic idiom in C, just given a specialized syntax in C++.
Thank the stars this didn't & won't happen!
Bjarne has been stuck in "C++ is the best & only language anyone needs" long after the world has moved on to Java, C#, Python, Ruby, JavaScript, etc.
C occupies a sweet spot combination of:
- low-level with "no magic"
- small enough for most people to "hold in your head"
C++ matched these conditions for a brief time in it's life - the early 90s aka "Stroustrup 2nd edition" - when the only "magic" was basic virtual functions, and templates where just a promising experiment in an appendix.