Live data from Hacker News

Rust Learning Path from Novice to Mastery

nativebyx.dev

21–26 of 26 posts

Re: Rust Learning Path from Novice to Mastery

#21
post #19
post #10

I keep seeing "how to learn X" and a series of tutorials, exercises, or courses. Maybe it's me, but each time I learned something, it was by doing projects. Usually, starting with modifying someone's code (while seeing a language for the first time) and then reading a tutorial to understand what's going on. It gave two things - a context of an actual project (especially as usually ecosystem is more important, and tri…

> projects That's exactly what "Zero To Production" is about. Actually most of what makes Rust intro material good is that you are building things, not just going on about syntax and language particulars. For example, "The Book" (what we call "The Rust Programming Language") ends with building a multi-threaded web-server.

The official Rust introduction is stellar! One concept at a time, clearly explained, with examples.

And, most importantly, it is complete. It starts with how to install it, and the installation actually works in a few lines of code. The authors put a lot of effort into the general onboarding user experience.

Re: Rust Learning Path from Novice to Mastery

#22
post #6

At what point would you suggest switching from tutorials to building a toy project? Finding it hard to judge. Sooner seems better but at risk of missing major understanding pieces which could end up being slower in total

I wouldn't treat it as a binary. Use the project to provide feedback on what learning material to read, then go back to the project until you hit another blocker.

Suppose you're read a book about Rust and now you want to write a web service. You take a peek on Reddit and hear good things about Axum, so you check out its docs.

You write some handlers that do crud operations on a database, and it's all going well. You can translate the examples in the docs into your code in a pretty straightforward way.

Then you decide you want live chat. You've heard of websockets, and axum has a websocket example. But you keep beating your head against the compiler. What is the right type for a chat room? Who owns the chat rooms?

You realize now would be a good moment to take a step back and learn more systemically. After reading through the tokio mini redis tutorial async makes a lot more sense and you're back on track.

In this example you "wasted" a little time before you took a step back and studied async more, but you saved significant time by tailoring your learning to what you needed. If you hadn't gotten partway into your project you might not have realized you'd want to learn async next and instead studied something else.

Re: Rust Learning Path from Novice to Mastery

#23
post #16
post #6

At what point would you suggest switching from tutorials to building a toy project? Finding it hard to judge. Sooner seems better but at risk of missing major understanding pieces which could end up being slower in total

Just get the basics down for traits, borrowing and move semantics. Make sure you have thorough understanding of heap and stack. Once those are down you can move on to projects. Rust is sufficiently complex that you have to do projects to encounter every nook and cranny of even the core language. Other language like python expertise in the language often involves knowing the libraries.

Thanks - I guess its time for a bit more tutorials first then. Traits & borrow is still very shaky

Re: Rust Learning Path from Novice to Mastery

#24
post #4

I love how culty the Rust sphere is. I don't have many opportunities to use it but I always stop to watch tutorials/read articles because of how enthusiastic people are about the language

True. But nowadays, zig is the new rust!

Except that zig is really really really not production ready. It has major bugs pretty much everywhere and fundamental stuff breaks/changes every other month.

comptime is cool, and I see a future for zig or its ideas, but not in less than 5 years.

Re: Rust Learning Path from Novice to Mastery

#25
post #4

I love how culty the Rust sphere is. I don't have many opportunities to use it but I always stop to watch tutorials/read articles because of how enthusiastic people are about the language

True. But nowadays, zig is the new rust!

Aside from using Rust as a Python developer with extensive outdated C/C++ experience, I'm really tempted to dive into Zig for all what it's praised for, but nim's hot code reloading [0] feature is so very tempting to me, that I'm not sure if choosing Zig would be a mistake. I do this constantly in Python and would love Rust to have this included in some easy to handle way.

In any case, I'm totally happy with Rust, and apart from the missing hot code reloading, it's so enjoyable to code in.

[0] https://nim-lang.org/docs/hcr.html

Re: Rust Learning Path from Novice to Mastery

#26
post #20
post #12

Earlier quoted context omitted.

As I am completely and unapologetically biased, Zig hits me the wrong way when in it's default help output it mentions "exe" and "dll". barf.

If that's your main issue with the language then Zig is probably awesome. Makes me want to try it in a simple tool.

Hah, yeah. I'm silly that way. I don't like that it doesn't have macros. It's not something I need to look into at the moment anyway. I'd probably never find a use case for it.
Post reply on HN