Python developer here just switched jobs to one that does C++.
Let me warn you right now. It's not worth it. At all. Don't go down this path. Memory management is easy, but that's not the only crap you have to deal with.
Templating and the whole C++ ecosystem with Cmake compiling to make is a giant headache. It takes about a week to integrate a new C++ library in source code and people are worried about installing or "trying" out new libraries because of memory leaks.... while in python I'll install an entire library in seconds just to try out a function.
I would say if you made an app in python and the same exact app in C++, the C++ app would perform waay better. No question. But the developer experience and effort required to make that same app is much much more painful.
> while in python I'll install an entire library in seconds just to try out a function.
but... surely you are aware that the memory leak concern absolutely does not disappear ? you just choose to not care about it in the python case for "reasons" - likely you've never been hit by a system which appends to a dynamic array without ever emptying it, and that can happen in every single language in the world.
lol thats not a c++ problem. Cpp is different lang than python. If u don't have experience with c++ stop complaining about it. And regarding developer experience it doesn't matter if end consumer are going to get slow bloated app which need python runtime to be installed lol.
I do have experience. It's my main language and my current job. C++ really sucks to work with for a developer even with types.
For building cloud services where apps are bottlenecked by the database, the user experience is roughly the same as C++ but the developer experience with python is much much much more easier.
This attitude where consumers have to run the apps or install a runtime to run the app on there personal machines is much more rare nowadays.
You deploy to the cloud. The customer downloads a web page and that functions as a client that communicates with the python server. Just like how most programming is nowadays.
But if you want a customer to download an app, which is much more rare nowadays than you can do what Eve online does or iron mail. They deliver actual client side python apps. I don't know what they use internally or how they did it, but pyinstaller is one option you can use to build a python executable.
The effort required for this makes it not worth it.
If I want a library in python it takes about a second to install with one command, and these libraries tend to be safe so you're not going to get any resistance if you want to try out 10 libraries in the next hour or so, which is sort of impossible with c++. Also these libraries are easily uninstalled and isolated from other python apps you have. No need to use massively complex package managers like nix to handle isolation.
Fuzzing a library just isn't something that's done in python. The developer just installs it and manually tests it 5 or 6 times in a shell and it's part of the ecosystem in 5 minutes.
If you accidentally leave unused libraries in your code and it gets pushed to prod it's a non-issue.
I switched to c++ because I was ok with the verbosity and also the complexity and also dealing with memory. But literally every single corner of the c++ ecosystem is a pain in the ass to work with. It's getting to the point where I'm just annoyed all the time. If you want high performance apps go with rust or golang. C++ is just not worth it.
For a C++ dev moving to python is like night and day. Imagine a programming environment where you only have to deal with the intention of what your app should do and not all the yak shaving that comes with it on the side. I know some and they tell me they would never go back to c++.
You would use C++ for a service or very focused component that does one thing well (like a database, or crunching numbers). For those, even Rust is not always a good answer.
You shouldn't use C++ as the backend for your marketing site, or some simple crud backend where a JIT runtime with GC will do.
Hell, if you're even building a small compiler today a JVM language or Go is a better choice.
But if you need to allocate memory yourself, C/C++ is very hard to beat. Games and systems dealing with huge chunks of memory will always go this route... and just (most likely) copy the dependencies into version control and deal with things that way.
It doesn't matter if the majority of applications are web applications. That doesn't make C++ less relevant because that was never the target audience.
Let me warn you right now. It's not worth it. At all. Don't go down this path. Memory management is easy, but that's not the only crap you have to deal with.
Templating and the whole C++ ecosystem with Cmake compiling to make is a giant headache. It takes about a week to integrate a new C++ library in source code and people are worried about installing or "trying" out new libraries because of memory leaks.... while in python I'll install an entire library in seconds just to try out a function.
I would say if you made an app in python and the same exact app in C++, the C++ app would perform waay better. No question. But the developer experience and effort required to make that same app is much much more painful.