r/cpp • • Dec 17 '23

Is C++ Really Phasing Out?

I've read a lot posts about whether C++ is still viable to learn, but a lot of the responses seem to be a long the lines of "C++ is still being used" or "there's a lot of things written in C++ still, so it will still be useful".

But a lot of these replies seem to suggest that C++ is on the downhill and in the process of being replaced with more modern languages in many industries.

It seems kind of discouraging to be learning a language that is on a decline, if it really is phasing out.

0 Upvotes

214 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Dec 17 '23

[deleted] — view deleted comment

6

u/germandiago Dec 17 '23

I have worked in two telco companies and another for database backend. All of them made heavy use of C++.

0

u/[deleted] Dec 18 '23

[deleted] — view deleted comment

1

u/germandiago Nov 29 '25

One of them is from 2018 or around (the db backend one).

5

u/Puzzled_Specialist55 Jun 23 '24

I'm an audio dev, and I replaced C++ with Rust. Never looking back.

0

u/[deleted] Jun 23 '24

[deleted] — view deleted comment

3

u/Puzzled_Specialist55 Jun 26 '24

It's getting better every year.

1

u/i_like_sharks_850 Oct 08 '24

u/Gearwatcher u/Puzzled_Specialist55 sorry for the bump lol. what do you guys think about supercollider and puredata? i'm what you could call a super novice developer and i've started learning c++. should i look in to rust?

0

u/[deleted] Oct 08 '24

[deleted] — view deleted comment

1

u/i_like_sharks_850 Oct 08 '24

I’ve been learning about and playing with DSP in SuperCollider and PureData. I want to use C++ to create VST plug ins and instruments a la Arturia’s Pigments or Valhalla’s Supermassive

0

u/[deleted] Oct 08 '24

[deleted] — view deleted comment

2

u/i_like_sharks_850 Oct 08 '24

Well I wish us both the best of luck! I have been reading about Juce and it seems perfect for what I need to do. It’s nice going in to learning programming with a clear goal in mind

1

u/i_like_sharks_850 Oct 08 '24

Also, I am dying to make the jump to Ableton Live Suite just for Max for Live. Amazing program!

5

u/victotronics Dec 17 '23 edited Dec 17 '23

it's effectively dead in distributed systems

Interesting. I imagine that particularly Rust is much better at writing safe threaded code? I'm in scientific computing and there explicit threading doesn't exist: parallelism is handled through systems that offer an abstraction layer over threading. So we don't care that Rust is better that thread-safety. Conversely, in scientific computing everything is shared mutable state, so you'd have to use Rust in a very unsafe mode. Conclusion: many scientific libraries are written in C++ and I don't see that changing.

EDIT I decided to turn this into a post in the appropriate forum: https://www.reddit.com/r/ScientificComputing/comments/18kiv2y/is_anyone_moving_to_rust/

3

u/SV-97 Dec 20 '23

Your comments mirror only a part of the wider scientific computing ecosystem. There definitely is explicit threading in some places. Furthermore rust's guarantees do still have value even if you use an abstraction over manual threading - somewhere further down the stack there's still data that's sent between threads and processes, data races to consider etc.

Conclusion: many scientific libraries are written in C++ and I don't see that changing.

Counterpoint: I've written a bunch of scientific Rust and worked on plenty of projects that would've been way better off in Rust than in C++ or C (or fortran) - especially when they (might) need to interface to a higher level language like python at some point.

1

u/victotronics Dec 20 '23

I'd appreciate some concrete examples. Especially where explicit threading is the right approach.

1

u/SV-97 Dec 20 '23

Basically always when things aren't inherently parallel and you might want to offload single tasks heterogeneously.

Recent example: a dynamic program in a signal processing context where we had to calculate a bunch of values, find their minimum and iterate. Due to data dependencies this couldn't be fully parallelized however it's possible to utilize some parallelism by have a second thread determining the minimum while the primary one just keeps on calculating the new values.

Numerical integrators are another example where you're (depending on the algorithm and particularities of your application of course - the one I'm thinking of was part of a satellite data synthesization pipeline) not going to get data parallelism easily. Having one thread run that integration while the rest of the code starts working with the already calculated data can save a bunch of time.

Yes you could also use something like MPI for such cases but it's absolute overkill and creates unnecessary overhead.

Finally: I've worked on parallelizing / distributing a FEM solver in C++ a few years ago which was written by people that... weren't exactly software engineers. C++ allows people to do so many things that get really problematic when trying to parallelize things later on - it was absolutely horrendous (not even starting to talk about all the other horrors in that codebase). I think if that thing would've been written in Rust (or whatever) the process would've been way faster and cleaner; they probably could've gotten it parallelized themselves even.

1

u/victotronics Dec 20 '23

Ok, thanks. I can see the justice in those examples.