Game World!

Join A World Of Gamers

Enter your email address:

Delivered by FeedBurner

Followers

Popular Posts

Tuesday, 29 June 2021

Should I learn C++ or rust first?

 Hello all o/

all 16 comments

[–]burntsushiripgrep · rust 53 points  

Learn both. It sounds like you're excited about Rust. One of things that has always served me well is to, whenever possible, pursue things that I intrinsically find interesting. (Another angle that I've used is to find a way to make something intrinsically interesting, but this is hard for me articulate.) In my experience, when one finds something intrinsically interesting, the learning experience is not only heightened, but it's fun. Use that to your advantage and learn as much as you can. Do it in your free time, and let your classes teach you C++. Learning both will also be advantageous since they cover very similar domains, so you'll be learning very similar material from different perspectives. More connections in your brain should make the learning process all that more enjoyable. :-)

I miss my time as a student. Even though I also worked part time, there was so much time left over to learn things!

[–]icefoxen 12 points  

Also, learning Rust will probably teach you a lot about modern C++ and why it is the way it is.

[–][deleted] 21 points  

  • Learn to be a programmer, which is someone who can pick up any language relatively quickly. (though Rust can be an exception!)

  • it is always good to know some C / C++ because it is foundational to much of the computing world and is one of the few languages that lets you get pretty close to the hardware, and really understand memory, intrinsics, SIMD, and so on.

  • Rust is amazing and I think may have a bright future, it is worth learning as well, especially if you are interested in fields where performance and/or correctness are very critical. space ships? cryptocurrency? financial industry? game servers?

So yeah learn both.

[–]StefanoD86 6 points  

Probably you don't have the time to learn both simultaneously. So my suggestion is to lean first mainstream languages and that would be C++ in this case. The reason is just you'll gonna need these mainstream languages in practice. C++ is also fun and interesting to learn. But after one or two years, you can start with Rust.

BUT: This is just an opinion! I can't tell you, what really is the best for YOU!

[–]mdaffin 5 points  

Nothing is stopping you from learning, or at least becoming familiar with, both.

If you are excited by rust then I highly recommend it as you will be far more motivated to learn and delve into it in more detail. But if your course requires C++ then you might need to learn enough of it to get by and you never know you may find it interesting as well.

Really there is nothing stopping you from getting your feet wet in both languages as required and they will likely not be the only/last languages you learn. It also becomes easier to pick up other languages once you have the core understanding of one as the fundamental concepts apply to most languages.

So I would suggest you pick one - whichever you prefer and start learning that. Pick up the other as required or if your interests change or just you want to gain some more perspective on your chosen language. Once you know a bit more about both the languages you will be better able to answer this question yourself.

I am not really sure what else you are expecting from this sub as most people here are here since they like rust and so will be biased towards it.

[–]ReversedGif 5 points  

Rust and C++ are similar enough that most things you learn for one will be at least applicable to the other.

[–]newpavlovrustcrypto 9 points  

We have a graphics course in our uni, and i am pretty sure they use c++ for that.

You can do low-level graphics in Rust as well (if not better) as in C++. (check gliumvulkanogfx-rs)

The biggest "why I shouldn't prefer Rust" is that for some domains ecosystem is still in its infancy. (e.g. while I think Rust will be an excellent choice for robotics in future, but C++ has decades of library development and developed communities behind it, so it's very hard to compete today)

Rust can be a very rewarding language if you like to write something from scratch and get to know stuff from inside out, but not so if you want quick and dirty solutions.

[–]sirpalee 8 points  

You can do low-level graphics in Rust as well (if not better) as in C++. (check glium, vulkano, gfx-rs)

Not exactly. None of these libraries is mature and stable. For example, gfx-rs is going through a big rewrite atm if I'm not mistaken.

Feel free to correct me if I'm wrong.

[–]newpavlovrustcrypto 5 points  

If you are planning to write full-blown commercial game engine, then yes, you can't consider them mature and stable. But for university project I believe they are more than applicable.

[–][deleted] 3 points  

Learn both!

[–]killercup 2 points  

No question: Learn both. But assuming you already know another language (C, JS, something like that), you might want to start with Rust!

[–]sirpalee 2 points  

Easy, learn both. Both languages have their shortcomings compared to the other.

[–]liquidify 2 points  

Why decide? You will be best off if you do both.

[–]epicwisdom 2 points  

Learn C++ first, then Rust. C++ is more powerful, has a much bigger ecosystem, and forces you to think about memory the hard way (i.e. raw pointers, unique_ptr, shared_ptr). You'll appreciate the modern features and cleaner design of Rust much more once you know some C++.

[–]Hitife80 1 point  

I'd say from purely pragmatic perspective -- i.e. if you want to learn a language that you can then find a job with -- C++ today is a better bet. Hopefully Rust will be added to sites like Hackerrank soon.

Go with Rust if your goal is more to enjoy the process and learn some new and future-proof paradigms. I do hope Rust will replace C++ in many applications, but it will take (quite a long) time. I personally would prefer not to learn C++ (too late for me though :-( ) if I can jump straight to a better language like Rust. I just don't see a lot of value in chasing segfaults and concurrency bugs when those can be avoided altogether by a good compiler and theoretically sound language constructs. It will also be easier to find a Rust job as time goes by -- being early on the "scene" is an advantage of sorts...

[–]ojrask 1 point  

Understanding the basics of both languages can be a good thing. You don't have to become fluent in both at the end of the day. Rather know a little about something than nothing about something.

Floating Button

Button