r/rust • • 8d ago

Started Rust Journey Today

I'm an entry level backend developer who got fed up with python since it doesn't teach good fundamentals. Right now I'm quite excited about rust as I've heard about it much and also did research on it. My goal is to understand computer fundamnetals at low level and write better software and become a real engineer. Right now I'm not doing it for money since I'm a high schooler. And I'm quite excited about the learning curve and frustrations people face. Though my goal is not learning code but understanding the underlying systems and writing safe code. Tell me if my excitement will really vanish or not. I'll also like some advice.

0 Upvotes

25 comments sorted by

10

u/Thelmholtz 8d ago

Look into r/learnrust for advice and stuff as you go on.

As for my part, my advice is to start with the book.. You can choose either Standard flavour or Brown, but either of them are a must read to get into the language.

1

u/Thick-Profile-1924 8d ago

I'm actually learning from the book along with rustlings. Also what do you mean by flavors? I'm learning from the official rust book.

3

u/Thelmholtz 8d ago

Yes rustlings is cool too. The only thing about the book is that it assumes you understand a bit about how a computer works. At the very least the stack, the heap, and pointers. 

But this might not be obvious to you (it wasn't to me when I learned it 20 years ago), and if that's the case, my suggestion is either the K&R C or even an introduction to computing course. Mine was in Motorola 82HC11 assembly and even though it's way simpler than modern x86; it laid the foundations of my software career in a way I'm not sure a higher level approach would have.

My point is if you struggle with a non-Rust concept, or even with the why's and how's of a Rust concept such as ownership or lifetimes, go lower level, and then bubble back up to go over that part again with the gained understanding.

2

u/Thick-Profile-1924 8d ago

OK. Thanks for the advice bro. I'll definitely do it.

4

u/sayboom 8d ago

Python is a great language and great tool for some tasks. I wouldn't abandon it. But look mostly at Architecture, how things work, because any language its just a tool

2

u/Thick-Profile-1924 8d ago

I haven't abandoned python. I've chosen rust for understanding the underlying systems as python isn't great for teaching those.

3

u/MxnunxM 8d ago edited 8d ago

If you want my advice, learn C and C++ as well if you want to learn how the hardware really works. C is very interesting because basically every popular programming language was inspired by C bit at the same time it's small and "simple", but, just like C++ it lets you write and compile very unsafe code, and they both have a "trust the developer" philosophy to have real low overhead and direct hardware access. The downside is that the compiler (or the compilerS I should say, since there are so many and it's a little confusing at first) isn't as clear as Rust's compiler. C++ is also very interesting because of its history and huge ecosystem, the language has multiple ways to do the same things because it stays backwards compatible with 1998 syntax while also adding new better ways to do stuff. The only downsides Rust has are the slow compilation time and the smaller ecosystem, but it's an amazing language nonetheless, and it has amazing Developer Experience. I hope I didn't confuse you with all this jargon. Just like I think Rust made C++ better, I think learning C++ will make you a better Rust developer, and vice versa.

Oh and regarding on how to learn, I would suggest the Rust Programming Language Book (better yet, the interactive version of the book made by Brown University) for Rust, learncpp.com for C++, and Beech's Guide to C Programming for C.

I recommend to learn the basics in all 3, then try to build something you think of and learn "on demand" (if you need something or don't know how to do something, look it up on these docs and learn it). I wouldn't suggest trying to finish all the documentations just to "feel productive". You can also watch some tutorials on YouTube by bro code for example if you're confused by the C++ compiler or IDE setups.

I suggest Zed Code Editor for all 3 languages honestly, even though CLion is better for large C/C++ repositories because of its high level indexing and refactoring

Good luck :)

1

u/Thick-Profile-1924 8d ago

Thanks for the advice. But my goal is to remain on software and not moving as low level as hardware. Also my goal is backend enginerring, so I think rust is the better call for me.

1

u/MxnunxM 8d ago

I was editing the message while you replied hahaha

Well yeah as I said C is more for curiosity and history, but you can build lots of high level software with C++. If you really want to only stick to high performance safe backend then yeah Rust is a great choice, I would suggest learning Go as well.

C++ can be used for backend as well, and I would say Rust, C++ and Go are the top 3 fastest backend languages, but what the best choice is depends on the project type

1

u/Thick-Profile-1924 8d ago

Yeah, thanks. As I told before, I will move to those languages when I need to, though I'm planning to stay on Rust for low level production work since both C and C++ are quite unsafe and people learni g C/C++ find it harder to learn Rust than.those who have experience with GC languages

4

u/cmdjunkie 8d ago

Don't look at it like you're "learning rust". Pick something you want to build and learn how to program it in rust. The excitement should be about the journey (the process of learning and programming) en route to the destination (the final, working, functioning, compiled program). And here's the rub: once you've completed your first project in Rust, you will not have learned Rust, but you have have learned how to program (if you didn't learn how to program before). You will have programmed something using Rust.

I've been coding Python since 1999, and I still haven't "learned Python", but I know how to use it.

2

u/Thick-Profile-1924 8d ago

I know. But my goal is to leanr about systems and underlying software architecture. I'll build projects after I've gotten a solid grasp of ownership and borrowing. By the way, thanks for the advice bro. I'll definitely keep it in mind.

0

u/cmdjunkie 8d ago

You're doing it backwards. Build projects TO learn ownership and borrowing. Not the other way around. Programming rewards doing and action.

1

u/Thick-Profile-1924 8d ago

Oh I get it. Thanks for the advice. I wasn't planning on learning everything from the start and then build projects. I'll develop a mental model for ownership and borrowing for some time and then build a project with it. Is this right?

1

u/cmdjunkie 8d ago

So.. back in my day, it always started with an idea. Like a... "it would be cool to write a program that could identify a code cave in a binary and inject some hidden message in it." Or, "how hard would it be to write a binary that can scan for and identify a vulnerable remote service, exploit it, copy itself to the host, and repeat the process?" Then, you set out to implement the most basic functionality of the program you've conjured up. In the first example it would be, well, how do I analyze the byte code of a binary and how do I determine what bytecode can be overwritten without disrupting the execution? Then, of course, you set out to do that in whatever language you choose. Often it's the one you either feel most comfortable with, or the one you feel will give you the desired footprint with the resulting compilation. Start with the idea, figure out what part you can/should work on first to get it running, and then start hacking away until it work. The "hacking away" part is where you start to learn the intricacies of the language. If you do this enough, you will start to learn how to use the language. You will stop researching every single thing and it will become natural to you.

I remember when a cybersec colleague of mine used me as a reference for a development job. The guy that called me had his doubts about this friend of mine's ability to code (because he was more of a cyber guy). He asked me if he could code, but more specifically, is he someone that can build something from scratch. That was the distinction, and here, I think that's the distinction between knowing and not knowing a language. I think it's fair to say you know a language when you can build something from scratch with the language without too much research on syntax and primitives. Just my two cents.

2

u/neerajprime 8d ago
  1. buy a good rust book or read online
  2. use local AI or any hosted solution. You need a bouncing board to be available at your learning time to answer simplest of queries in distraction free environment verbose enough for you to understand quickly.
  3. use rustc directly on a command line terminal

2

u/Thick-Profile-1924 8d ago

I'm actively doing point 1 and 3 you mentioned but....I'm skeptical of learning with ai since I've done it before and just learnt that it was just a false sense of progress. So I'll use ai for understanding concepts but solve frustrating problems myself since that's the old and best way to learn, doesn't matter the era.

1

u/neerajprime 8d ago

Let me clarify (2) and see if that still makes sense.
Lets imagine that the borrow checker is fighting with you and you are clueless how thats gonna work. Unless you have a friend, or online community member or an AI, how else do you intend to get the answer. In this world of AI I would first use AI as my bouncing board to understand whats going wrong. This was earlier done on stack overflow, which has now shifted.

a) You could bypass (2) and search the internet. Thats what all of us used to do in the pre-AI era. It still works, but depends on how much time do you have.

b) You could read the Rust spec, with to my best knowledge is a combination of rust-lang.org and rustc source code itself. I have personally taken pride in reading ISO standard for C and C++, spending years doing it, but if I were to start today then I'd not recommend that.

1

u/Thick-Profile-1924 8d ago

Yeah. You're saying right. But I'm talking about trying to solve it myself for the given amount of time and then ask ai but not directly. I'll first ask it to explain the problem and try to formulate hypotheses myself and if I still can't do it, I'll ask for a solution and also an explanation of it. This not only strengthens muscle memory but also develops problem solving skills which is the main goal.

2

u/La-ze 8d ago

I would suggest C to learn fundamentals over Rust. Rust is amazing but it does abstract things away from you like memory management. C code is very close to the underlying ASM and since it's manually managed memory, you'll learn the core fundamentals.

1

u/Thick-Profile-1924 8d ago

Thanks for the advice and I respect it but I also don't wanna go too low level. Thta's why I chose rust. And also I'll learn it in college since they teach such fundamentals. If I needed it ealier, I'll learn the necessary concepts.

2

u/La-ze 8d ago

To be clear C is a high level language, it's just a really simple one. Some may use the term mid level language.

Rust has a steep learning curve and without an understanding of pointers and other fundamentals I fear you'll going to be very frustrated with the barrow checker and some other features of Rust.

Though to each their own.

1

u/Thick-Profile-1924 8d ago

Actually, this topic is debated. Some say starting fresh and learning rust concepts with time is better if you have basic programming knowledge which I already have with python. You might belong to the other side and as I said before, I respect it. And I will heed to it if it really becomes the case for me, so thanks for the advice.

1

u/raflsspace 8d ago

Honestly your excitement won't vanish if you look at each language by the problem it's trying to solve.

I started out with java and also spent a lot of time working with go, and only used python when i needed a specific ecosystem for a problem. Java and go made total sense for getting things shipped with decent structure, and python is great when the tooling around a specific domain is already mature. then when I finally picked up rust, it suddenly clicked why it exists in the first place, because you start seeing all the memory and concurrency headaches the older abstractions were hiding from you.

That said, rust really is pretty cool once things start clicking, the level of control (measurable) and confidence you get when something finally compiles is hard to beat. You didn't waste time with python at all, it actually gives you the context to appreciate why rust works the way it does. Just enjoy the struggle and focus on the problems you're trying to solve, every language just adds another way of thinking.

1

u/every1sg12themovies 4d ago

if i were you, i would grab a book about computer fundamentals. it's quicker way than trial and error and learning just enough to get by but not really understanding how it fir in larger schema of things.