Learn Rust by building real-world examples
shuttle.rsI went through some of the articles and the general format there seems to be loosely annotating the finished code examples piece by piece, instead of building it up piece by piece. With Rust, this approach is going to fail you pretty quickly, getting lost in syntax, types, and colloquialisms. Not a fan, might work just to get things working. Synthesis is more challenging.
I recommend going through Advent of Code. After doing the last two years' challenges, I was able to write a WebAssembly/HTML5 game from scratch, and not banging my head against the wall. It's a lot more important to understand how to build with the fundamental blocks, managing memory, references, and control flows. AoC gives the platform for that.
AoC feels like leetcode but with weirder UI so the users can feel more like hackers.
This is accurate. Maybe it's silly but it really does change the way I feel about the problems. Doing leetcode makes me think "Here I go again, grinding for corporate approval, getting ready to see everyone else's answers that are 10x better than mine and let the imposter syndrome set in" while AoC is more like "I'm so excited to see this year's problems and compare my answers to everyone on Reddit. What day will I make it to this year? What kinds of twists and turns do they have in store?" So for me it feels like AoC is more a community of excited hobbyists learning programming and trying new tech while leetcode is full of corporate bullshit trying to make me feel bad about myself, and part of that is definitely from the UI.
Personally I prefer the leetcode UI, but I find that AoC challenges are usually grokkable problems where leetcode seems to require you to have a ton of very bespoke data structure and algorithmic knowledge that simply doesn't have a purpose for me besides doing more leetcode
Yes, I think this is the major difference. LC are specifically geared to test DS&A knowledge: trees, graphs, DP, BFS, DFS, greedy, etc. AoC are more about iterating fast to solve it however.
I think I used all of these structures/algorithms for AoC. Post day-16 ends up with these often.
I would absolutely not recommend leetcode for learning Rust. Leetcode has an unreasonable obsession with linked lists and dancing pointers, which are always going to be a bit awkward in Rust. The also used unnecessarily complicated types for some of the Rust code which makes it even worse. When I hit those questions I switch it to C++.
This isn't a knock against Rust. That type of code is more painful in Rust but it's also extremely rare in the real world.
The few AoCs I've done didn't have any of that.
100% it is really well done, fun leetcode problems that get gradually harder.
You can also follow a tutorial written for another language. I've been going through a C graphics programming course [0] using Rust. The C code is helpful to see exactly how things work, but I can't just mechanically copy the C code and trick myself into thinking that I'm learning.
[0]:https://pikuma.com/courses/learn-3d-computer-graphics-progra... Do recommend
Stefan, the author of the course, is hands down one of the best Rust instructors out there. Huge kudos for getting him on board, shuttle.