Should I Choose Rust or C++ for My Project?

0
3
Asked By CuriousCoder42 On

I'm really excited about a small project I'm working on, which will use SDL3 plus a few other libraries that are compatible with both C++ and Rust. I've managed to create prototypes in both languages, but now I'm trying to decide which one to fully commit to before I dive deeper into development.

I've found that Cargo has a much easier learning curve compared to CMake, though I know it might offer less flexibility. I'm also concerned about which language is better for cross-platform building once my project is ready for release, especially using GitHub Actions.

From what I see, C++ has a steeper overall complexity, yet it seems to have a smoother initial learning curve that could speed up my development. There are also way more libraries available for C++, even though they can be a bit scattered on GitHub. On the flip side, Rust appears to have modern libraries and more active developers working on it lately. I've noticed that a lot of projects, especially in WebAssembly, are heavily written in Rust, with good C++ bindings.

Honestly, I really want to use C++. I've dreamed of learning it for the last 25 years but didn't get a chance until now. Rust is easier to set up, but I find its ownership and lifetime concepts quite confusing and overly complex. While I know Rust is safer when used correctly, I feel C++ would suit my project just fine. Any advice or insights would be super helpful! Thanks a bunch!

5 Answers

Answered By TechSavant101 On

Rust can be a great choice if you're curious about it, but for your current needs, it sounds like C++ is the better pick since you want to finish your project.

Answered By CodeNinja90 On

Honestly, if you want to get things done quickly, I’d say stick with C++. It’s evolving constantly and has loads of libraries. Plus, you can write safe code without the enforced rules Rust has—you just have to be more careful about memory management yourself.

CPlusPlusDev -

I wanted to like Rust too, but it just doesn’t sit right with me. CMake can be tricky, though, especially for cross-platform work, which is why I explored Rust to begin with.

Answered By DevAdviceGuru On

It seems like C++ is more aligned with your interests. If you find it difficult later on, you can always pivot to Rust—or any other language! Just be aware that working with memory manually can be challenging, especially if you’re not familiar with it.

MemoryMaven -

I'm making a game, so I wonder if Rust will ever catch up to C++ in that area.

Answered By CodeMaster89 On

If you prefer learning C++ and aren’t a fan of Rust’s features, then C++ sounds like the way to go for you! Just make sure to utilize smart pointers to handle memory automatically instead of doing it manually.

RustFan93 -

So you mean like using unique_ptr and shared_ptr? Are there any others I should consider?

Answered By ProgrammerSam On

Both languages have their merits, but with C++, you'll have an easier learning path due to more resources and community examples. If you’re leaning towards C++, just go for it! They’re both solid choices, but it should be what you enjoy more.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.