Hacker News new | ask | show | jobs
by ksk 3212 days ago
C++ is a tool for low level systems programming. Why would you compare that with GO? Also, I would argue that C++ is _WAY_ more popular than GO. It allows you to be productive in the real world, utilizing legacy code, legacy libraries, APIs, etc. Very few projects are 100% greenfield.
1 comments

Many desktop apps are still written in C++.
"Many" is an understatement here. Pretty much every Windows desktop app is written in C++ and Windows runs on over 90% of all desktops.

Adobe will never rewrite Photoshop in Rust or whatever. If you thought burying COBOL was hard.. C++ will outlast humanity.

I can already hear the Alien scientists: "An amazingly intricate and convoluted language for such a primitive species. The mismatch between their mental abilities and their language might explain the bug which caused the incident.."

As someone that has spent quite some years writing Windows software, actually since the .NET introduction and the maintenance status of MFC, the majority of Windows desktop apps are written in a mix of .NET and C++.
> Pretty much every Windows desktop app is written in C++ and Windows runs on over 90% of all desktops.

I think you may be the one overstating things. Where I work, a biomedical device firm, for every one app written in C++ there is either one python or matlab prototype of it and 5 python/matlab apps to test it/show it off. I'm sure for other places that number is far higher. I honestly don't see how you could quickly prototype sufficiently complex ideas any other way.

Better said, I can build a working Kalman filter, load saved patient data to it, create a primitive db, save output data to said primitive db, build a primitive, but functional enough that non-technical people can use it, GUI, from scratch, to plot said output data in Python all in a couple hours. Can you do that with C++ for the same time frame? Heck can you do it within an order of magnitude of the time I used? If you can't, why should you be spending an order of magnitude more money for it?

You wouldn't have to rewrite Adobe. You could rewrite one component of it (0 cost FFI). That's fair more reasonable. I think Servo is proving that Rust has a lot of potential for slowly replacing a C++ codebase, piece by piece.
On Windows, Rust still has the problem that it needs to be as easy as C++ for working with COM, specially now with UWP.
Is anybody using C++ with UWP? I would have thought the obvious choice was C#.
Yes, via C++/CX and when C++/WinRT gets ready by the end of the year, it will eventually replace C++/CX.

Also note that Blend has first class support for C++/CX projects.

https://moderncpp.com/2017/08/25/cppwinrt-2017/

Of course most developers using C++ with UWP is Microsoft itself, for stuff like XAML engine and the new Visual UI composition engine, and game devs.

XAML is also the official replacement for MFC.

As I mentioned in some other thread today, there is hardly any pure C++ application nowadays on Windows, they are mostly a mix of .NET and C++.

Sure, people will ultimately use the tool they think is right for the job, given the people they've hired, etc. C++'s strength isn't UI programming (might be generalized to things that require more input from designer's than programmers), but writing high-performance, low-abstraction code (which could very well be the dominant factor in the success of the desktop app, hence the choice).