Which language gives users more control, C++ or Rust


#1

Please answer this question if you are well experienced with both C++ and Rust.


#2

Neither.

Some things are more convenient in one or the other, but unsafe rust can do anything C++ can, and vice versa.


#3

What can C++ do more conveniently compared to Rust?


#4

Honest question: are you looking for a piece of information that wasn’t already covered in your previous thread?

It seems like you are looking for a simple answer that doesn’t exist.


#5

I just can’t seem to find a good tutorial for Rust, with C++ tutorials I have found they are much better at teaching compared to Rust tutorials, so I want to know what is different about it.


#6

That seems like a very different question.

Why is “more control” the criterion you are most interested in?


#7

Cause a freind of mine uses C++ a lot and when he tried out Rust he said that he found it more restrictive.


#8

It is more restrictive, indeed. But only in the sense that a car with seatbelts is more restrictive than one without: both reach the same top speed, but only one of them will save you in a bad day :blush:


TWiR quote of the week
#9

Oh lol thanks bro, are there any good tutorials out there for Rust?


#10

New Rustacean is a good way to get started, along with reading the book :+1:t2:


#11

Rust by example has good explanations, with code that executes straight from your browser (it gets compiled somewhere else).


#12

And to extend the analogy, you’re not going to try flying upside-down without a harness :rocket:


#13

It is because of age. C++ is around long enough for people to write good tutorials. The rust documentation and other tutorials in the ecosystem are good enough for a language that is stable for 3 years.


#14

https://doc.rust-lang.org/book/second-edition/index.html


#15

@Joe232 Why don’t you tell us more about what you personally what to achieve with systems programming languages like C++ and Rust as well as expanding on why the question of control would be important to the work you want to do with these languages?


#16

I do want to get into robotics, as well as game development for Godot.

I have seen some C++ used in Godot (in an example) and it is not really hard to use at all when you are making a game as you are just using Godot’s libraries so I wanted to use it over C# as you can get better performance, yes I am well aware that system’s programming language != speed but in Godot’s benchmark test with all the languages used, C++ was the winner over the rest of the languages.

I do want to learn more about computers and doing low level programming will give me extensive knowledge about how things just work.

Honestly I have been trying to find good video tutorails for Rust but nothign really seems to exist. Yes sure there is Rust docs but I find the video tutorials more helpful (its just me personally) and so far there are much better tutorials for C++ than Rust and I am even finding C++ easier to learn compared to Rust (as the Rust tutorials sucks).


#17

If you are looking specifically for video tutorials, I think you’re going to have a hard time finding something that really fits your needs. And this goes back to what @dylan.dpc said about the age of the language.

On the other hand there are a few streamers out there that use Rust in their live coding. So you might be able to find something that almost-kind-of-sort-of matches your expectations with what you’ve seen for C++. You just have to know what to look for… Searching Youtube for “rust-lang tutorial” brought up hundreds of results, and the first two I clicked on were basic hello-world tutorials with good clear video and audio. (I can’t comment on the quality of the tutorial content, though.)

To give you at least something to start with, it just so happens that I met a guy at a demoscene meetup a few years ago after GDC. He started writing emulators (and other tools) in Rust as part of his live coding Twitch channel. You can find all of those videos now on his Youtube channel.

The Nintendo 64 emulator playlist is probably a good one to start with, since the first episode actually walks you through creating a crate, and discusses how to find and navigate the Rust documentation. I haven’t actually watched the whole series (it’s a LOT of content) but it seems like it might be similar to what you’re looking for, in terms of ultra-beginner-friendly instructive videos. He has some other relevant playlists as well.


#18

Yes correct, however I have already in the past started with thenewboston and he is quite good (the best in my opinion). Yes I know nobody can get me where I want to but at least he can start me off before I do my own stuff.

Now I have tried using Rust tutorials and one quy was pretty good at teaching, but he for no reason stopped making tutorials (I hope the dude is ok), and the other tutorials aren’t that great, they tell you this and that but sometimes fail to explain certain things, and some just rush :confused:

Some people tell me that Rust is not even fully ready yet and there are still stuff that needs working, am I correct with this?

That is not to say that I will not learn Rust. Off course I will learn Rust, as well as C++ as there are more job opportunities for C++ and better support for Godot as well while learning C++ helps me learn Rust as well.


#19

I wonder what a video tutorial can give you, what a text tutorial won’t. IMHO a video is not as good as a text, because it dictates the speed of learning. If you haven’t understood a part, you have to rewind to the exact time and hear it again and again. In a text you just go up a few lines and you can read as slow and fast as you please. You can read every sentece twice, as it makes sense to you. (But maybe I’m just too old for this youtube tutorial bs :smiley: (no offense :wink: )).
For general tutorials in rust I can tell you: “Just do it!”. You learn it, as you program. Go and make a simple application (here a few suggestions)

  • read a number from stdin and print it
  • generate a random number and make a guessing game
  • read a file and try to copy it to a different location
  • list the content of a directory
  • copy all files from one directory to another

… The possibilities are endless, but you learn it by simply doing it (just like any other regular (human) language. So go and install the toolchain and happy rusting :wink:


#20

For some value of “fully ready”, sure. In the same sense that C++ isn’t fully ready either, as evidenced by the current C++ specification. Any language that isn’t completely at its end-of-life is in some form a work in progress.

That doesn’t mean that Rust and C++ are not useful. Or to remove the double-negative; “that means that Rust and C++ are still useful.” I hope you understand that practically every concern you’ve had isn’t quite so black-and-white as you seem to believe.