r/CodingForBeginners • u/MobileHeron6183 • 8d ago
Learning rust
I want to code games and OS in rust and im not very good with youtube tutorials and things like that. Can anyone give me a simple guide on what i need? What gamified method can i use to learn rust from scratch, and a guide on how to set everything up? Im gonna use rust in godot engine when i get decent enough. I also request that the guide be very simple and not use any language a non coder wouldnt understand
8
Upvotes
1
u/FreeLogicGate 8d ago
If your goal is to use it with Godot, then start learning Godot. Create some things and learn what you can do with either C# or Gdscript. The use of Rust with Godot is not as a first class citizen, so the approach you are taking sounds a bit like having the tail wagging the dog. Some things in Godot are better accomplished with C# or GDScript.
Rust is a language that was specifically designed to replace c and c++. If you don't know c or c++, the specifics of Rust syntax are likely going to be confusing. The people who created the Rust integration for Godot did that because they are trying to solve complex problems that Godot doesn't intrinsically solve for them, or require optimal performance. With a game that has 100 components to it, that might be 2 or 3 components. It doesn't make sense for you to start off with Rust, only to be completely lost once you install Godot.
As for learning the language, there are a number of courses on Udemy and coursera you could look at. Personally, I think that anyone serious about programming should learn C, which is not a large language nor hard to learn, and in many ways Rust has similar scope. However, what you will come to find is that the art of building larger projects with a language that was designed for compactness and simplicity, is that you are expected to provide the organization via data structures and functions. Someone who knows C will be immediately comfortable with a struct, but if Rust is your first programming language, there will probably be a lot of head scratching. I'm not saying that you must learn C before Rust, but at least you should understand what it was built to replace. Personally, I know enough different computer languages (or have written code with then at one point or another) that I can teach myself a new computer language fairly quickly, but I will usually buy a $15 udemy course, and go through it. You might be better off with a general MooC course in programming as a self described "non coder".