Comment Ease of Use (Score 1) 184
I would say this is true in that it's primary target originally was systems programming.
But it has seem to have taken on a lot more than that moving forwards, such as compiling to webassembly with frameworks such as leptos
Or full blown desktop applications with libraries such as egui
Most people tend to focus on the memory safety as the biggest reason, but I would say actually there are a lot of other different reasons for it gaining popularity.
1. It has a easy to use build system (cargo) it just builds on any platform including windows or linux and cross compiling is extremely easy even for embedded.
2. you can bring in libraries or external crates (build time dependencies) without magic cmake scripts / autoconf / automake / scons / Makefiles / any number of different build tools
Arguably this can lead to supply chain attacks, but the trade off is you can keep those libraries more uptodate and it's easier to add them without git submodules or other workarounds
3. No worrying about different size int's on different platforms with different custom macro's between libraries to check the size of an in at the operating system level
4. Full static typing, no ambiguity with pointers or structs
5. traits (interfaces) more of a C++ feature
6. modularity or namespaces, no having everything in a global scope such as what C does or the old pre module Javascript does where every function call has to be unique.
You can work around these in C with tools like valgrind but it's not perfect
7. Readable and helpful error messages, where it points you at the likely candidate for the fault
8. No legacy headers to worry about
9. Macro's are actually useful not magical for the most part, such as default values or serialisation
Dealing with the borrow checker or typing can be a little tricky, but I've found AI / chatgpt actually works wonders for this if you just use it for that reason only