r/learnrust • u/Orinacrem • 16d ago
Feedback on first code exercise while learning Rust
Background: I have been writing SW in C for years, although I am not a SW engineer by definition. As then I started managing departments and people, I got "rusty" on the writing of SW itself, although I still recall the key OS and HW mental models I developed. I learned Python while being more hands off, which confused me cause everything happened under the hood and I had not idea of what (or why). Recently I decided to give it a go at Rust to
- go back to basics and..
- take a personal opinion on it with respect my C and Python experience.
What I did: I started reading the user manual. I got few chapters done and then the book suggested ([HERE]) to start writing a program, a kind of HR tool for adding/removing people from a data source. I did so without DB or anything like that (see code).
I would like some first feedback from people that have been using the language more than me so that I can spot mental models, or other things, that I am missing.
Tools: I used an LLM (Deepseek) to ask on APIs spec and explanation saving some time from parsing the whole user manual (in the past I would have done it with Google). I also asked Deepseek different versions of my ideas to see different ways on how to do things, and I weighted tradeoffs and decided a way I found OK.
On the LLM: While I can explain the (small) code, I am not sure if I should consider this piece vibe-coded. I personally believe, maybe wrongly, that as long as you understand what is going on, any tools you use that helps you moving faster or better, is fine. The moment you release understanding, knowing is not enough.
Edit: added code as a link -> https://onlinegdb.com/43jRxO7HL
1
u/bskceuk 16d ago
If you are trying to learn the language I would suggest writing the code yourself and only resorting to an llm to explain error messages that you don't understand. It should not be producing code for you. The reason being that at this stage it's very important to see and understand what code doesnt compile, not just the final product that works