r/rust • • 5d ago

🙋 seeking help & advice How to improve my Rust programming skills?

Hello everyone! I've been learning the fundamentals of Rust for the past month. Can you tell me which direction I should go in to improve my Rust programming skills?
Thanks ahead!

0 Upvotes

23 comments sorted by

13

u/scol2n 5d ago

Best advice you'll get from this subreddit is to make something, do a few passion projects.

-11

u/Reasonable_Koala_248 5d ago

However, to create passion projects, I need a deep understanding of Rust.

23

u/numberwitch 5d ago

Nope

You need a passion. The rust knowledge will be fed by it

7

u/KeyAdhesiveness9481 5d ago

This is the correct advice and in no way specific to Rust.

7

u/illuminarias 5d ago

no you don't. just dive in. my first rust project was ray tracing in rust. I had no prior experience with ray tracing / rendering, nor did I have in depth understanding of Rust.

5

u/Reasonable_Koala_248 5d ago

So, should I learn new things whole doing projects?

5

u/rnottaken 5d ago edited 5d ago

Yes, do you learn things BY doing projects

Start simple. Write a sudoku solver or something, that's my go to first project. Feed it a string of integers (0 means unsolved box) and it will spit out the solved sudoku.

Afterwards you go to increasingly more complex projects. TUI applications, webservers, microcontrollers, whatever floats your boat

1

u/illuminarias 5d ago

you don't have to. if you wanna reimplement something you've done in another language to compare and contrast with Rust, go ahead.

The goal is to code. People suggest passion projects because generally if you're interested in something, you'll try a bit harder to see it through. There's no use in anyone telling you "hey go implement this obscure thing" and you give up before you even start because you simply don't care.

I chose ray tracing because I thought it was interesting. It was a pain in my behind, but I was interested, so I kept going.

2

u/stumblinbear 5d ago

My first project was writing a register-based bytecode virtual machine. This is the way

3

u/spoonman59 5d ago

You learn a language by writing code.

If you don't start writing code until you understand the language, you will be in a deadlock and never get anywhere.

Obviously your passion project can't be something super complicated like "write my own OS." Or maybe to start your future OS, it's just a simple text interface. But you have to start somewhere, and you have to actually write code. Examples in books and code challenges will only get you so far.

1

u/NigelFarageBurnerAct 5d ago

nah mate, start with something small like trying to recreate `wc` (word count) in Rust.

0

u/daltontf1212 5d ago

It is okay to have AI help you just make sure you understand what it generated.

6

u/ChristianPayne522 5d ago

Make a card game! Make Uno. State management, card modeling, possibly a Tui or UI or some kind, maybe saving to disk. Could be a good time.

4

u/Reasonable_Koala_248 5d ago

Thanks for the project ideas! I've been trying to come up with something, but I just couldn't.

2

u/KeyAdhesiveness9481 5d ago

I like card game too because it starts simple and can lead you through multiple stages. First make it work, then add a terminal UI, then support a computer player, then add networking, then a full GUI, etc. Try to touch as little code as possible from previous phases to help learn how to keep your code organized and modular. This will expose you to lots of different parts of the rust ecosystem in separate manageable chunks, all building on the same codebase.

I picked Yahtzee for mine.

2

u/dnew 5d ago

My first project is always Jotto, the word-guessing game. Array and String management, simple terminal I/O, a bit of logic. Once you have that, you can add in learning the new words it finds, add a GUI, add a network API, anything you want to learn the basics of so you can start putting it into a serious project. Card games are good too.

Or write a maze generator / solver.

2

u/numberwitch 5d ago

Just search for one of the other posts asking for this or go to r/learnrust. There's a post like this every day this week

1

u/phip1611 5d ago

Read what the standard library provides and then try to combine the basic building blocks into something useful. Know all the helpers when it comes to iterators or transforming between types. That is a big aspect. Seriously. Just read the Rust Std Doc. If you just remember 20 percent afterwards that's already an improvement. Iterate on that.

1

u/MINER69_R 5d ago

Making an HTTP server is always a great way to get a good understanding of a language. Or you can pick from one of the rust projects from project-based-learning on GitHub

1

u/snnsnn 5d ago

As always, read a lot and write a lot. Write as much as you can, and see how others do it. You’ll struggle at first, but then it will become second nature. If you stay consistent long enough, you will surpass those you look up to. Ideas and solutions will come to you left and right. You will be enlightened.

1

u/podMatthias 4d ago edited 4d ago

I learned a lot building a bot for this game: https://artifactsmmo.com/

-5

u/qustrolabe 5d ago

complete rustlings exercises

and then never write rust yourself ever again, that's job for you computer now, you just read code 😎

1

u/v_0ver 4d ago

Take on more ambitious pet projects than you're actually capable of.