ERRATA - I'VE BEEN INFORMED RAZORSECURE ARE HIRING INTERNATIONALLY - THEIR WEBSITE IS WRONG! APPLY AWAY! - read the rust book offline with `rustup docs --book` - 4:03 the correct link is science.sciencemag.org/content/331/6018/772
@@NoBoilerplate Missing subtitles perhaps? Some folks are hard of hearing and that’d be an improvement. Don’t really think I can call it an “error” though.
Being able to tell the definition of a monad is quite different than really understand what is a category, what's an endofunctor and, finally, what's a monoid. All of those concepts are taught in an Algebra 1/2 class. That being said, I really advise against giving the said definition when explaining what's a monad in a programming language, what does it do and why it exist.
Being ancient (73) I am enjoying Rust. This is because I started with assmbler and C when hitting the hardware, and having learnt about foot damage I understand the ideas that Rust brings. Perhaps the way to learn the benefits of Rust is to try the job in C, fall down the hole, and then harness Rust. (Although I am fond of C, and modern compute machines can do all the splendid compilation and build checks that a PDP-11 would take a week)
That's terrific to hear, thank you! I've talked with many developers who cut their teeth on assembly in the PDP era, who are delighted with Rust for similar reasons!
I am so glad you mentioned cloning over and over because I preach it to others haha. The single most helpful thing I did for learning rust is NOT to borrow. Lots of cloning, returning objects over and over. It got me used to data lifetimes and moves. By making it redundant I understood it. Then borrows felt like a natural optimization. It created a gentle learning curve. I mentor a lot of junior devs and the dopamine hit of getting something that works is ESSENTIAL for motivating newbies hahah.
As someone who knows that copying and cloning is “slower”, I didn’t take that approach. But I can honestly say cloning and copying everywhere is a much less painful way to learn.
It's far more important to discourage newbies by constantly reminding them that there are better ways of doing it, endless frameworks, approaches and new programming languages to learn. Then they will realize how futile it all is and the desperate need for widespread automation.
That's the way I make just about anything in Rust. Unless I know immediately that "this function will always only have a reference" I will simply resort to cloning. Prototyiping becomes at least twice as fast, and when everything seems good enough I can just start replacing parts of the code to avoid cloning everywhere. The performance is more stable than a GC language even when ruining it with cloning regardless though. To clarify the last part, it's not necessarily much faster if done "incorrectly", but you avoid GC spikes.
@@TehKarmalizerdamn I am just starting with rust by building a clone of our company app which originally uses C#. This will really help my understanding thanks! I am using Tauri to make our currently windows only app cross platform. So its a win for my work and for me too because now I have one more thing I can add to my professional experience.
How to learn the benefits of Rust: First attain 15 years of working experience in C, C++, asm, JS and Python. Do all sorts of projects in them, across all sorts of scales. See what sorts of problems plague each of them. And then go to Rust. You'll now have motivation to breeze through the initial vertical climb, to the lands of joy beyond.
this is why i still recommend JS or Python for folks who are just getting into coding - give them the languages that make early stuff easy, get their imagination going, and then help them learn the tools that will help them build it
@@tempest_dawn I'm not totally against that idea, but I'd suggest that if a new coder is excited by what they hear about rust, let them code it - all languages are pretty much the same - we're only talking about 1-2% difference in day-to-day life (though I obviously REALLY LOVE that 1-2% difference!)
@@NoBoilerplate i don't think it's necessary for everyone - i've just tutored a lot of folks who had a hard time getting their head around what was possible like if they were determined i'm sure they could learn rust first, and for many people that will work, but some people need some early excitement to find that determination first - if that excitement comes from hearing about rust they absolutely should go for it, but if they're starting from a position of "i've heard programming is cool but what can i do with it" i'm more likely to suggest they start with something else for a bit
This Video had my brain fried. The sentence "failing a test first, then learning better" is so aligned with my own experience you couldnt imagine. Also you really have to take the test, when just looking at old exams it does not has the same effect. My mind was blown. Thanks again for your content.
Your experience with feelings about lifetimes exactly maps to mine. At first it was annoying. Now I see them as a powerful tool that I absolutely miss in other languages.
@@NoBoilerplate That won't really happen, for the same reason that you cant omit types from function signatures, it simplifies type inference a lot for the compiler and for humans as well. Rust really looks at only one function at a time. It only sees the current function body and signatures of called functions, so you need to inform it about the lifetime relationships between values. This too is also a readability advantage for humans. I think the error messages will get better if anything changes with them.
Lurker here, I've been learning rust for about a week now and I've gotten further with it than I ever have with any other language. I came from JavaScript, and if anyone is on the edge of deciding whether or not to learn it, I wholeheartedly agree that you should definitely give it a go. This video is 100% right
for folks coming from javascript, beware. you might regret learning rust because you'll long for rust while coding javascript. at least that's my personal experience
@@advanceringnewholder so true. As a solo fullstack web developer it’s almost never practical for me to use rust in my projects when the rest of the codebase it js. It’s torment
I find the difficulty of lifetimes to be analogous to the difficulty of Rust as a whole: it forces you to think about things up front that you can, in other languages, either ignore entirely (Python, JavaScript, and sometimes only up to a point), or spend endless painful hours debugging under higher technical debt pressure later on (C, C++).
Ive been trying to learn Rust for a while now and every time I get discouraged and stop for a bit I see one of your videos and it inspires me to keep going. Thank you!
Coming from Haskell to Rust i appreciate how nice the ergonomics of tooling and how large the ecosystem already is. Every important library is sufficiently documented, the compiler is so quick and helpful, for every problem there seems to exist a library you can build upon, and you can prototype quickly with lots of copy and clone but the code is still frickin fast.
Isn't it wonderful! I suspect one of the reasons for this is that a *lot* of people, like you and I, are coming from Haskell! Finally we get a popular language with lots of the features we love!
9:17 A little extension to this part: Use references in function parameters. There are other places where using references can mess you up, but in function parameters that can't really happen. You don't need to reference number types though, passing a reference is just as or more expensive than passing the thing itself.
I think this isn't 100% true. I think that, for beginners, mainly people coming from GC languages, it's important to get used to how data flows, and drop the reference usage when unnecessary (given that pretty much any GC language just uses references everywhere). It forces you to think a bit more functionally, which Rust incentivizes, and as bonus, code is easier to read. It's a purely "psychological" difference, but I think it matters
There is a slight misunderstanding in this comment. In rust you don't think in terms of pass by value vs pass by reference, you think in terms of borrowing a value vs taking ownership of a value. It is up to the compiler to determine if values should be copied or passed by reference, in fact only types that implement the copy trait can be thought of in pass by value vs pass by reference terms, but it is better to always think in terms of borrowing and taking ownership otherwise you might end up in strange situations. Also a type should only implement the copy trait if it makes sense that a value should be copied bit wise (because that is what the Copy trait is for) otherwise you should use the clone trait instead.
This is a beautiful video. I tried learning Rust but also gave up at lifetimes. Then I got into Haskell for entirely unrelated reasons and I noticed how many similarities they shared. Now I know neither of them, but hopefully I get a little better in the future.
I didn't knew "test to learn" is a term someone defined until now. I always do this and helped me to learn many things every efficiently although there are some disadvantages. I thought this process is only my thing until now. Will read the book, thanks for recommendation.
this is a pretty good way of learning it! i especially like the re-taking test comparison: when i learned rust, i look up the very basic syntax, then i tried (and obviously failed, as expected) to write a medium sized project. In that way i also learned what to do better next time. when I *really* learned afterwards (aka reading the rust book, as one does) and made stuff that actually worked, the realization "ahh, thats how you do it, now i know what i did wrong" was amazing! this early designed-to-fail project helped me get a feeling for what i needed to learn
I downloaded the Ultralearning book on audible. I'm already half-way through. Although you mentioned this book only briefly, it's insane the wealth of knowledge in there that even extends farther beyond Rust or even programming. Thank you for the outstanding recommendation!
Been here a while and while I code for work in a range of languages I'm enjoying being inspired by you to keep delving back in to Rust. Great to see the channel growing and you continuing to be the Great Brit we all knew you were!
I started watching your videos 4 months ago and went through a lot of rust resources(including the book), projects and a lot of compiler errors. Javascript was my first language before Rust. I just love how rust prevents you from shooting yourself in the foot every step of the way. It also gave me one more superpower to learn any other C like language but faster.
Great guide, I followed it by reading ultralearning, the rust book and now I'm working through the exercises. Really great method for being able to recall "oh I remember something about blank, I know how to solve this or look for more info". (Context I have been a C#/js developer for a while so programming isn't new) Some examples: - rust needed linker.exe to compile properly, I remembered from the book that this is a tool that C++ uses to make exe files, I added C++ development with VS build tools and it works. - cargo install isn't working, oh yeah this is the rust package manager, ok cert issue is probably due to some firewall/config issue - this exercise can be solved by adding a return statement OR if I remove the semi-colon, rust knows that the value is being returned - oh yeah you can redefine variables in a scope and it doesn't change the outer one - variables are immutable by default, that's right I can use the mut keyword!
Fantastic! Glad to hear it's working out for you - by the way if you're on windows, all these issues can be sidestep with WSL, and many more you're gonna hit in the future. WSL2 is REALLY great, I'm so impressed, give it a go!
This is one of the best ways I have ever found to learn for myself. When I find a way to 'skim' material quickly then go back to review it I always do much better at understanding and retention. When I used to always start at the beginning try to learn one step at a time, my brain would struggle with what to do with this new information, and how it might relate to everything else causing me to not have a great mental model.
In a critical undergrad course (Organic Chemistry), the professor would hand out a pre-test. Most students ignored it for the first couple of tests, but having done the pre-test, I noticed a pattern. Most all Organic Chemistry reactions are totally reversible, It is often the conditions of the reaction that push it one way or another. What the prof had done was have us do the steps of the reaction in one direction, doing “electron tracing” in each step. On the TEST, he had questions on the reverse reaction. Bingo!!!! I picked up on this and scored a 100% on all my exams. I tried to get other students to study with me. The few that did wound up making A’s in the class. It is a perfect example of “Test to Learn” and seeing patterns.
Lifetimes are a real game changer for APIs. At first you think it is a chore for memory but later you realize the power of type level state and use-only-once methods/services
Thank you for Side Quest #2, I had completely missed this resource and it has been very illuminating so far! You videos are what inspired me to learn rust, keep it up!
Woah, thanks for the pointers. Obviously, some people might learn differently but this definitely sounds plausibly better than what I'm doing: Reading the book throughly and doing quizzez on the first go and occasionally doing exercism exercizes. (All of which I mostly do during downtime at work)
I hate to do this to you, but you need to read about python's Global Interpreter Lock. A feature they plan to still have in Python 4. Great for learning and easy code, absolutely falls apart at scale. Python's great though! Keep on coding in it, you'll eventually want to learn other languages, and you'll find it easier to learn the next one, which can be Rust :-)
One thing that I think is especially difficult to learn is working around the borrow checker, but even more importantly, knowing when you shouldn't work around the borrow checker. When I just started learning Rust, I had worked on a project where my design didn't really work well with the borrow checker at all. No matter what I tried, it wouldn't compile. At the time I remember being extremely frustrated with Rust, however in hindsight I now see that the reason the borrow checker didn't like my code is because it wasn't well-designed. I would have saved so much time if I had just planned ahead and come up with a design that didn't have circular dependencies. Even in languages without a borrow checker, designs like that will eventually be your downfall - I've had many projects devolve into an unmaintainable mess due to poor planning. Basically, while I didn't realise or appreciate it at the time, Rust's design was pushing me towards better software design from the get-go.
That's a really great take and one I was helping a patron I'm mentoring out with. Tree structures are REALLY easy to reason about so long as they don't have cycles! Nice!
That kind of inversion can be really useful, though, like when parents know about their children, but children also know about their parents. It can be done in roundabout ways, but they may be more prone to other kinds of programmer errors than simply allowing that kind of relationship.
I fell in love with rust when i ran the complier the first few times and it gave advice for my code. something about the complier enforcing preemptive/preventive coding habits just clicked and showed me that this was a language made by experienced teachers and I'd have a great time learning rust, and even how to code
Everyone kept telling me to not learn rust as my first program Language. And from all the online help I can fully say. Its hard but dont give up and dont listen to the haters
You can learn rust as your first language and if your primary goal is to make stuff with rust, then do that. But if the goal is programming in general then choosing something easier first is good to avoid frustration
I completely agree. I have a similar graph that shows complexity and scale at 7:29. By placing the right tech in the right place, you can flatten the inevitable complexity curve and dramatically increase velocity, which improves both the quality and speed of delivery.
The thing I find most awesome about Rust is that if it compiles, the program works flawlessly almost EVERY SINGLE TIME. As a game programming hobbyist, I can honestly say I made more progress in a mere 3 months with Rust (while learning it on the fly, no less), than I had in the previous 3 years using C.
Went from py and some JavaScript to Rust and it was kind of fun working through the rustlings. Didn’t think there would be a whole bunch of new concepts to learn
I must say - words "Rust isn't difficult, it's unfamiliar" completely changed my perspective and motivated me to finally learn Rust. I was bouncing from it 3 times, but now - thanks to this - I know I will succeed. It's hard to leave my JS comfort zone, but it's the right thing to do. 😊
Thanks for another excellent video. I’ve also found Rustlings to be pretty much best-in-class for that sort of learning tool, but didn’t know about the Brown edition of The Book and am looking forward to checking that out.
I'm learning RUST by myself from 1year, today I fully understand Sender Receiver of thread and Arc Mutex. I think I'm not talented but Rust itself cross the line ABSOLUTELY IMAO.
Sir, I am currently learning Rust, lifetimes had me stressed out for weeks! Thanks for being indulgent about it in your video, it makes me feel like I can still work with Rust not using lifetimes every single time and will eventually learn how to use them anyway!
I fully agree with the "No references only copying" tip. They way rust handles solves the memory management problem is by a logical enforcement and tracking of move semantics (By using the abstraction of 'Borrowing'). If you are a C++ developer. Move semantics are one of the most complex advanced topics that you will have to deal with. Having rust developers have to worry about that from the start is madness. Specially when they come from high level languages and they don't even know about pointer or "The heap"
The problem with cloning is that you will lie awake at night thinking about how your could remove it. Even if it barely affects the performance of your code. I have one problem I've been stuck on for 3 years where I wanted my function to take in an iterator and return an iterator, rather than having to collect() it into a vector. Problem is along the way a new struct gets created that the resulting iterator must hold as a reference. Tearing my hair out about how to make that struct live long enough.
Great video as always. I'm always talking about Rust to developers. The learning curve is always a turnoff, but I often explain (as you do) that it's steep, but flattens of rather quickly. The other worry is having to worry about things they didn't used to, so I also suggest they can go really deep with memory concerns, or just ignore that, clone everything, and worry about performance later. Inevitably, they're already picking up using references before it ever gets to a performance issue simply because they're modeling their problem more correctly now. So this video is rather validating for me.
2:04 I tried to buy the book but the shipping was 3x the book's price, so I went with the electronics copy... The best book I ever read about some programming language(still reading it and I am reading it whenever I have a few minutes to spare)! Thank you for the great video ❤ Keep it up 👌 🎉
I'm delighted for you! Also, something I forgot to mention in the video, ALL the books are available offline with every rustup installation, just run `rustup doc` GORGEOUS!
Well spotted! It's actually even cleverer than that - I export my videos from Reaper at 2fps, this means I can render at about 40x realtime, meaning my turnaround time for video edits is EXTREMELY fast. Additionally, upload times to youtube are next-to-nothing, and I even feel like youtube's processing time is much faster, due to this tiny file size!
4:30 What you talk about here is a concept I discovered while learning to do various creative things digitally. Knowing what is possible first is a major key to learn MUCH faster. I had watched photoshop videos for years up until I finally pirated it in 9th grade. Took me little to no time to learn the tools 1 by 1, and pretty soon I was making decent edits. And now, about 2 weeks ago I took a photo of myself for my LinkedIn, and noticed some tape on the wall behind me. Because I took the picture in my room and I have sheets of paper with plans and stuff hung up to keep me in the right headspace. In like 5 minutes I had a perfect wall behind me with 0 blemishes of any kind, my hair was not messy at all and my suit jacket had no lint on it.
excellent vid. I appreciate the Haskell point for learning :) and especially appreciate the advice to avoid ref in favor of ownership and copying until the compiler pushes you.
9:55 When I was new to Rust, I didn't fear using references, even if they had lifetime annotations. Now, years later, I try to avoid explicit lifetimes alltogether and only use them if there is no chance to avoid them. But there are a few cases where I really want lifetime annotations, especially in structs. Normally when I want some kind of accessor to some data, which should not be modified or go out of scope as long as the accessor exists. For example I used this to call some function safely. Calling the function is only safe if I specify a valid parameter. So instead of calling the function directly, I created a struct, which lists all valid parameters, and in order to call it, I only specify the index of the parameter I want to call. But iterators are also a good example for this.
Many thanks for this. While I'm well into my second year with Rust and able to leverage fasterhanlime's projects, I am still rather slow when coding and fixing compile-time errors. Therefore: repetition and muscle memory are key!
Good vid, I started using rust about a month ago. My biggest issue still is learning more complex lifetimes. For example, the winit library uses a move closure for its event loop. This seems to create issues with 'static lifetimes and took me several days to fix. Ended up using a combination of Rc and Cell to create what feels like a hacked solution but it works.
That's a challenge for sure. You're operating much beyond the beginner recommendations in this video. I bet you know what is happening with your code FAR more than if you built it with a language that just magically handled things for you. Scaling will be easy for you!
I can only hope you can deal with the possible Stockholm Syndrome and escape the R community; that language and ecosystem is a great example of exactly what CS is trying to leave behind with these next generation languages (I say this as someone who started with R).
Thanks for the tips. I'm some chapters into the book already, and I was worried to follow your advice I'd have to start over. I'll keep charging through like I have been and then check out rustlings the second time. Thank you!
I stopped learning rust in jan then last month i picked it again and finally finished the book, completed rustlings. Now I'll do rust by practice and advent of code with this
Thanks for the Ultralearning recommendation! Nothing excites me more than a good book recommendation. Also, I'm going rusty because of you. You are a sneaky crab making everyone rusty 😂
8:39 this is the best view I've heard about the purpose of lifetime annotations. Prior, I never thought lifetimes like that. Cheers NB, for making concepts easy to explain.
This is probably your best video so far. Everything mentioned in this video is something I experienced while learning Rust. I think this is a valuable resource for new Rust developers who want to learn the language.
I started my programming journey with Python, and I still love the language for its simplicity and its ability to set things up and going. Then I heard about Rust, about how memory safe it is. It is a big step up, code seems harder to read at first. But the more I read, break down the syntax to understand what it does, I found clarity in Rust, it's predictable, it does what you tell it to and just you, or it can refuse to compile straight up, it wants you to be precise, and that has been the thing driving me to keep learning it.
It's been a long time since I started learning Rust, and I sure wish your video was available back then! Great summary of what to do to learn it, and the approach to lifetimes is exactly what I did (skipping the cloning). People who say Rust is difficult are just too used to fail at runtime. You could've also talked about unwrapping, and why it's a great tool for the developer to know what points of the program can fail. Great video, keep up with the good work!
You didn’t mention the version of the book with little quizzes mixed in! That’s how I went through it and being “forced” to understand stuff before moving on worked pretty well for me!
Struggling with so much, rust is very alien from what I'm use to which makes it very exciting to learn for me. I read right though the book quickly, and built some basic apps putting that knowledge to test.
great video as usual! did not expect to see a reference to haskell in a video about learning rust! that was a surprise! but a very good proposition. i'm in the process of learning rust after many years of being a professional js developer, while i'm still far away from being able to do any significant functionality in rust, i'm starting to really understand and appreciate its syntax and the benefits that come along with it. funnily enough, the concept of borrowing and ownership was probably the least complicated thing for me to understand, it was a lot more about traits and enums and all those things since i never really had much experience with typed languages. Looking forward to a future filled with many rust jobs and no more javascript pain.
Wow ! I was about to search "How To Learn Rust" and youtube recommends me a video that has the exact same title what I was about to search and thanks for the video as it was quick and on point.
Here is my dilemma: Yes rust is cool, and it can be fast, and it can be elegant etc. But in the real world, the C# JIT is so good that often the c# version of my app is faster than the rust version. Because all this added complexity nukes my ability to build the abstract ideas in my head first and just type them out. Now all of a sudden I have to have this hierarchy of ownership that locks down my architecture. If I discover a problem and need to redesign, it often breaks the entire ownership chain and requires me to basically start again. In C# I just change it, and the JIT does all that work for me
though you cant deal with unpredictability of jit, after you refactor some things in c# you never know how fast it will be, and with rust you almost certainly know it would be al least as fast (with some exceptions ofc)
I've been stalking rust for awhile. What I've heard the hardest part to learn is when the compiler is right and tries to guide you in the right direction vs when it's wrong and knowing the tips and tricks to guide it.
That's a reasonable thing to say, once you get past intermediate rust and start getting into the master-tier, the error messages are not as friendly. They're not *wrong* but they are no longer as helpful. Every single release (every 6 weeks) the core team improve the errors, so by the time you reach this stage, 1. The errors will be better 2. you will already know how great the language is and be happy to figure things out. I'm drafting a video on how to talk to the compiler (ie read errors easily)
A bonus motivation: AI doesn't know how to write rust yet. It tries, but it mostly fails. It might take it longer to learn it, so rust jobs will be safer for that much time.
Are you sure that you are safe? nothing is safe when AI start to master one of programming language, don't even ignore that what AI can do for next few months.. it is just the beginning
@@zigang93 I'm pretty sure I'm not, that's why programming is not my main focus, but info security and machine learning. I'm just saying that there are languages that need you to have deeper understanding on what's "under the hood", and it will take ai longer to master them.
Or it’s actually easier I’d say. The language is much richer, more exact and precise. And so is every open-source project that compiles. So it’s all there if the machine can read it.
I want to learn rust somewhere in the future, but not as of now. Still, everytime i see a new video of you, i make sure I can watch it as soon as possible. Your naration + videos are amazing.
You deserve more subscribers. Been watching your videos for a while now and I didn’t even bother to check your sub count or subscribe myself. You make me excited to learn programming each day- even tho I’m not learning rust. I want to get good enough at js and Python to really hate them so I can switch to rust but stay humble.
I'm so pleased! you can of course get a lot of valuable work done in JS and Python, I certainly have over the years, and there's nothing stopping you from learning Rust too! It's not like any of them will be the last language you and I learn, right? :-D
The thing about rust, is that I only started learning it a month ago and yet I already feel frustrated, when python, C, C++ or Java (I'm a CS student) does something in a way that Rust solves much cleaner and safer. I'm especially fond of how Rust handles exceptions. It's so much more natural than any other language I've seen
You can take a look at the "Rust Quick Start Guide---Master Rust Programming Basics" course recently launched by @Tintinland and the co-founder of the Rust language Chinese community and senior Rust developer Mike Tang. The course starts at the end of June. You can gain a deep understanding of the core concepts of Rust, develop simple Rust code independently, and get accompanied learning by technical experts. After the course is over, there will be job postings~ I have signed up!
I've been trying and failing to learn how to code for the last 2 years because I constantly tell myself that i will learn something else to make learning Rust easier, my intentions are more for a hobby standpoint as I'm more oriented to the SysAdmin\Cloud Architecture side of things, but this has motivated to start giving Rust a try (with patience) from the get go.
Somehow, Rust seems best or at least great for any use case at all. Many languages are marginally better when the problem is tuned in the right way, but focusing on Rust just seems a great move career- and life-wise as a developer.
As someone that has fallen off the rust bandwagon for the exact same reasons listed in this videos, this was very helpful. Also having some experience writing functional code with typescript and fp-ts, many of the functional concepts in rust become obvious and appreciated. Will be giving it another try
Good video, I seem to have stumbled into many of these things already by luck and there were new bits of advice. Thanks for saying I can copy and clone everything, validating for now. :)
After many months of listening to you evangelism, I have finally set aside a serious block of time to go through the Rust Book. Currently on chapter 7. I hope that you find time to make a video about how Rust approaches modules/submodules, public versus private stuff, paths, etc. The book itself uses this... utterly bizarre restaurant analogy that just baffles me
Good one. Many Thanks for sharing your knowledge and experience. This hobbyist gave Rust my best efforts but gave up. Now keen to try again. Will definitely be using your suggestions. Thanks again.
It's ok to give up and try again, as I did! Do watch my other Rust videos for inspiration, there's a LOT of exciting stuff here! Start here th-cam.com/video/oY0XwMOSzq4/w-d-xo.html
@@NoBoilerplate Many Thanks, Tris. Yeah, giving up and trying again is pretty much my standard MO, for lots of things. :-) I get bored if stuff is too easy LOL. I already had 'The Book' so quickly reading that again. Up to end of chapter 6 and kind of surprised at how much sense it's making. Must be remembering more Rust than I thought I would. Also picked up a copy of Ultralearning which is proving very interesting. Will be checking out more of your content for sure. Thanks again and Good Luck with all that you're working on
i am completely sold, i will do this after ive finished my bachelor thesis in 2 days. the free time after is heavily dedicated to learning spanisch and rust, 2 languages at the same time i guess.
It's too soon to judge. Something I learned while working in the UK Government's digital department was not to worry too much what the lawyers and politicians are doing, they do and say insane things every single day. And guess what: It doesn't really affect us very much down here, on a long enough timescale. In a year they'll be long gone, and we'll still be here, building the future. My attention is finite, I choose to use it on more interesting things 😄
I only learned lifetimes properly once I began messing with it, wouldn't recommend running away from it for too long. This time I stuck with it, insisted on having a borrow value instead of another method to force myself to deal with the problems, I ran into a lot of problems, had to rewrite a bunch of stuff multiple times, but I get it now. What really clicked for me this time how borrowed values must *outlive* the borrower, that somehow never registered in my head as I was learning before, everything became clearer after that.
I'm trying to use this power for awesome, not evil :-D If you want to hear me in a different context, I have a scifi story podcast I'd love to know what you think of th-cam.com/video/p3bDE9kszMc/w-d-xo.html
I started developing a complex Rust wasm project with all the juicy bits and pieces of an underdeveloped ecosystem at work head-first with little to no Rust experience months ago. And I learned one crucial thing: Rust's, both referring to the language and the community, focus on precision, correctness, and stability makes a 0.2.4 Rust library more reliable than some 2.x libraries I've experienced somewhere else. It's magical how productive I am with all the betas I use.
The hesitancy to go 1.0 in Rust comes from the requirements of semver versioning. 1.0 means you can no longer make breaking changes to the API, without bumping the major version. 0.x means "I'm not ready to guarantee to stable API yet." It says nothing about reliability or even completeness.
ERRATA
- I'VE BEEN INFORMED RAZORSECURE ARE HIRING INTERNATIONALLY - THEIR WEBSITE IS WRONG! APPLY AWAY!
- read the rust book offline with `rustup docs --book`
- 4:03 the correct link is science.sciencemag.org/content/331/6018/772
now THAT is a flex
Wild
@@Askerad I'll update it when inevitable mistakes are pointed out! I've yet to have a video that has no corrections 😀
@@NoBoilerplate
Missing subtitles perhaps? Some folks are hard of hearing and that’d be an improvement. Don’t really think I can call it an “error” though.
❤❤❤❤❤❤❤😂
For anyone wondering what a monad is: it's just a monoid in the category of endofunctors. Pretty straightforward, really.
And who is Malloc?
Questions for another time I guess.
@@thekwoka4707 Moloch's brother? :)
how did i not think of this?!
@@thekwoka4707 A prominent member of the band "Gorillaz"
Being able to tell the definition of a monad is quite different than really understand what is a category, what's an endofunctor and, finally, what's a monoid. All of those concepts are taught in an Algebra 1/2 class. That being said, I really advise against giving the said definition when explaining what's a monad in a programming language, what does it do and why it exist.
Being ancient (73) I am enjoying Rust. This is because I started with assmbler and C when hitting the hardware, and having learnt about foot damage I understand the ideas that Rust brings. Perhaps the way to learn the benefits of Rust is to try the job in C, fall down the hole, and then harness Rust.
(Although I am fond of C, and modern compute machines can do all the splendid compilation and build checks that a PDP-11 would take a week)
That's terrific to hear, thank you! I've talked with many developers who cut their teeth on assembly in the PDP era, who are delighted with Rust for similar reasons!
@@NoBoilerplate (With some languages you can iteratively machine gun both feet. I name no names.)
@@chrissaltmarsh6777 perl?
@@durnsidh6483 perl is special. All sort of body parts are at risk.
This was a real treat to read. 😂
I am so glad you mentioned cloning over and over because I preach it to others haha. The single most helpful thing I did for learning rust is NOT to borrow. Lots of cloning, returning objects over and over. It got me used to data lifetimes and moves. By making it redundant I understood it. Then borrows felt like a natural optimization. It created a gentle learning curve. I mentor a lot of junior devs and the dopamine hit of getting something that works is ESSENTIAL for motivating newbies hahah.
I'm delighted to have your account, thank you!
As someone who knows that copying and cloning is “slower”, I didn’t take that approach. But I can honestly say cloning and copying everywhere is a much less painful way to learn.
It's far more important to discourage newbies by constantly reminding them that there are better ways of doing it, endless frameworks, approaches and new programming languages to learn. Then they will realize how futile it all is and the desperate need for widespread automation.
That's the way I make just about anything in Rust. Unless I know immediately that "this function will always only have a reference" I will simply resort to cloning.
Prototyiping becomes at least twice as fast, and when everything seems good enough I can just start replacing parts of the code to avoid cloning everywhere. The performance is more stable than a GC language even when ruining it with cloning regardless though.
To clarify the last part, it's not necessarily much faster if done "incorrectly", but you avoid GC spikes.
@@TehKarmalizerdamn I am just starting with rust by building a clone of our company app which originally uses C#. This will really help my understanding thanks! I am using Tauri to make our currently windows only app cross platform. So its a win for my work and for me too because now I have one more thing I can add to my professional experience.
How to learn the benefits of Rust: First attain 15 years of working experience in C, C++, asm, JS and Python. Do all sorts of projects in them, across all sorts of scales. See what sorts of problems plague each of them. And then go to Rust. You'll now have motivation to breeze through the initial vertical climb, to the lands of joy beyond.
Right! It's so obvious in HINDSIGHT!
this is why i still recommend JS or Python for folks who are just getting into coding - give them the languages that make early stuff easy, get their imagination going, and then help them learn the tools that will help them build it
@@tempest_dawn I'm not totally against that idea, but I'd suggest that if a new coder is excited by what they hear about rust, let them code it - all languages are pretty much the same - we're only talking about 1-2% difference in day-to-day life (though I obviously REALLY LOVE that 1-2% difference!)
@@NoBoilerplate i don't think it's necessary for everyone - i've just tutored a lot of folks who had a hard time getting their head around what was possible
like if they were determined i'm sure they could learn rust first, and for many people that will work, but some people need some early excitement to find that determination first - if that excitement comes from hearing about rust they absolutely should go for it, but if they're starting from a position of "i've heard programming is cool but what can i do with it" i'm more likely to suggest they start with something else for a bit
This Video had my brain fried. The sentence "failing a test first, then learning better" is so aligned with my own experience you couldnt imagine. Also you really have to take the test, when just looking at old exams it does not has the same effect. My mind was blown.
Thanks again for your content.
you should read ultralearning, it's a great book!
@@NoBoilerplate already on it, got the ebook on my tablet the first time i've came across it, i think it was in your videos.
Your experience with feelings about lifetimes exactly maps to mine. At first it was annoying. Now I see them as a powerful tool that I absolutely miss in other languages.
The best thing is that they might eventually be mostly optional, the core team keeps making the compiler smarter and smarter!
@@NoBoilerplate That won't really happen, for the same reason that you cant omit types from function signatures, it simplifies type inference a lot for the compiler and for humans as well.
Rust really looks at only one function at a time. It only sees the current function body and signatures of called functions, so you need to inform it about the lifetime relationships between values. This too is also a readability advantage for humans.
I think the error messages will get better if anything changes with them.
@@theroboman727 theroboman more like the boogeyman
Lurker here, I've been learning rust for about a week now and I've gotten further with it than I ever have with any other language. I came from JavaScript, and if anyone is on the edge of deciding whether or not to learn it, I wholeheartedly agree that you should definitely give it a go. This video is 100% right
I'm excited for you!
@@NoBoilerplate
for folks coming from javascript, beware. you might regret learning rust because you'll long for rust while coding javascript. at least that's my personal experience
@@advanceringnewholder hahah yeah this is accurate
@@advanceringnewholder so true. As a solo fullstack web developer it’s almost never practical for me to use rust in my projects when the rest of the codebase it js. It’s torment
I just started learning Rust 2 days ago because of you. So this timing could not have been better! Keep up the great work :)
I'm so pleased! Do come and ask questions in #newbie-advice on my discord if you need help, and GOOD LUCK!
I read that as "Rust 2" 😂
Sir, where can I find your discord server, I have questions to ask.
Rust is a great language. It is time well spent.
weeeeiiiiiirrrrrd...exact same here
I find the difficulty of lifetimes to be analogous to the difficulty of Rust as a whole: it forces you to think about things up front that you can, in other languages, either ignore entirely (Python, JavaScript, and sometimes only up to a point), or spend endless painful hours debugging under higher technical debt pressure later on (C, C++).
That's a great way of looking at it
Ive been trying to learn Rust for a while now and every time I get discouraged and stop for a bit I see one of your videos and it inspires me to keep going. Thank you!
I'm so heartened, that's exactly what they are for :-)
Coming from Haskell to Rust i appreciate how nice the ergonomics of tooling and how large the ecosystem already is. Every important library is sufficiently documented, the compiler is so quick and helpful, for every problem there seems to exist a library you can build upon, and you can prototype quickly with lots of copy and clone but the code is still frickin fast.
Isn't it wonderful! I suspect one of the reasons for this is that a *lot* of people, like you and I, are coming from Haskell! Finally we get a popular language with lots of the features we love!
Started my Rust journey few days ago because of your channel. Having lots of fun coming from C
Fantastic! I'm so excited for you :-)
9:17 A little extension to this part: Use references in function parameters. There are other places where using references can mess you up, but in function parameters that can't really happen. You don't need to reference number types though, passing a reference is just as or more expensive than passing the thing itself.
Yeah, totally agreed, this sort of nuance you pick up in intermediate Rust.
I think this isn't 100% true. I think that, for beginners, mainly people coming from GC languages, it's important to get used to how data flows, and drop the reference usage when unnecessary (given that pretty much any GC language just uses references everywhere). It forces you to think a bit more functionally, which Rust incentivizes, and as bonus, code is easier to read.
It's a purely "psychological" difference, but I think it matters
There is a slight misunderstanding in this comment. In rust you don't think in terms of pass by value vs pass by reference, you think in terms of borrowing a value vs taking ownership of a value. It is up to the compiler to determine if values should be copied or passed by reference, in fact only types that implement the copy trait can be thought of in pass by value vs pass by reference terms, but it is better to always think in terms of borrowing and taking ownership otherwise you might end up in strange situations. Also a type should only implement the copy trait if it makes sense that a value should be copied bit wise (because that is what the Copy trait is for) otherwise you should use the clone trait instead.
@@tordjarv3802 yeah definitely, all this advice is for when the ownership model hasn't fully clicked yet.
Glad to have a video I can send to everyone I know who is learning Rust, awesome content!
Please do, that's my hope! :-)
Or everyone who is not learning Rust… yet
This is a beautiful video. I tried learning Rust but also gave up at lifetimes. Then I got into Haskell for entirely unrelated reasons and I noticed how many similarities they shared. Now I know neither of them, but hopefully I get a little better in the future.
You're primed for a big comeback in your Rust learning, good luck!
I thought you gonna close with, and now I code in JavaScript
I didn't knew "test to learn" is a term someone defined until now. I always do this and helped me to learn many things every efficiently although there are some disadvantages. I thought this process is only my thing until now. Will read the book, thanks for recommendation.
Cool! Yes, there's lots of other tips in the book, I recommend!
Will search for this book in my region.
this is a pretty good way of learning it! i especially like the re-taking test comparison: when i learned rust, i look up the very basic syntax, then i tried (and obviously failed, as expected) to write a medium sized project. In that way i also learned what to do better next time. when I *really* learned afterwards (aka reading the rust book, as one does) and made stuff that actually worked, the realization "ahh, thats how you do it, now i know what i did wrong" was amazing! this early designed-to-fail project helped me get a feeling for what i needed to learn
Fantastic!
I downloaded the Ultralearning book on audible. I'm already half-way through. Although you mentioned this book only briefly, it's insane the wealth of knowledge in there that even extends farther beyond Rust or even programming. Thank you for the outstanding recommendation!
My pleasure!
@@NoBoilerplate I came back to this video to find the name of this book, unfortunately not in description.
Been here a while and while I code for work in a range of languages I'm enjoying being inspired by you to keep delving back in to Rust. Great to see the channel growing and you continuing to be the Great Brit we all knew you were!
Hehe, thank you!
I've been planning to start RUST this week, and I see this video, perfect timing
That is great! Good luck, do watch my other videos for inspiration!
Its not an acronym BTW, so don't type it in all caps.
@@theroboman727 😐
No boiler plate totally doing this learning path for Rust learning thank you so much for your self-less free coaching on this matter
I wasn't expecting this, Nice!
I've only done a bit of rust, but that was for a project which is now finished, I'm excited to learn more
Wonderful!
I started watching your videos 4 months ago and went through a lot of rust resources(including the book), projects and a lot of compiler errors. Javascript was my first language before Rust.
I just love how rust prevents you from shooting yourself in the foot every step of the way. It also gave me one more superpower to learn any other C like language but faster.
I'm delighted!
Great guide, I followed it by reading ultralearning, the rust book and now I'm working through the exercises. Really great method for being able to recall "oh I remember something about blank, I know how to solve this or look for more info". (Context I have been a C#/js developer for a while so programming isn't new)
Some examples:
- rust needed linker.exe to compile properly, I remembered from the book that this is a tool that C++ uses to make exe files, I added C++ development with VS build tools and it works.
- cargo install isn't working, oh yeah this is the rust package manager, ok cert issue is probably due to some firewall/config issue
- this exercise can be solved by adding a return statement OR if I remove the semi-colon, rust knows that the value is being returned
- oh yeah you can redefine variables in a scope and it doesn't change the outer one
- variables are immutable by default, that's right I can use the mut keyword!
Fantastic! Glad to hear it's working out for you - by the way if you're on windows, all these issues can be sidestep with WSL, and many more you're gonna hit in the future. WSL2 is REALLY great, I'm so impressed, give it a go!
This is one of the best ways I have ever found to learn for myself. When I find a way to 'skim' material quickly then go back to review it I always do much better at understanding and retention. When I used to always start at the beginning try to learn one step at a time, my brain would struggle with what to do with this new information, and how it might relate to everything else causing me to not have a great mental model.
It's a really genius idea, I wish I had known about this effect at university! BTW Ultralearning has other great ideas in, a great read.
In a critical undergrad course (Organic Chemistry), the professor would hand out a pre-test. Most students ignored it for the first couple of tests, but having done the pre-test, I noticed a pattern. Most all Organic Chemistry reactions are totally reversible, It is often the conditions of the reaction that push it one way or another. What the prof had done was have us do the steps of the reaction in one direction, doing “electron tracing” in each step. On the TEST, he had questions on the reverse reaction. Bingo!!!! I picked up on this and scored a 100% on all my exams. I tried to get other students to study with me. The few that did wound up making A’s in the class. It is a perfect example of “Test to Learn” and seeing patterns.
awesome!
Lifetimes are a real game changer for APIs. At first you think it is a chore for memory but later you realize the power of type level state and use-only-once methods/services
Thank you for Side Quest #2, I had completely missed this resource and it has been very illuminating so far! You videos are what inspired me to learn rust, keep it up!
Wonderful, I'm delighted!
I've started the journey with the book, but never considered using rustlings and rust by example at the same time. Thanks for the video!
Very welcome!
Woah, thanks for the pointers. Obviously, some people might learn differently but this definitely sounds plausibly better than what I'm doing: Reading the book throughly and doing quizzez on the first go and occasionally doing exercism exercizes. (All of which I mostly do during downtime at work)
I hate to do this to you, but you need to read about python's Global Interpreter Lock. A feature they plan to still have in Python 4. Great for learning and easy code, absolutely falls apart at scale.
Python's great though! Keep on coding in it, you'll eventually want to learn other languages, and you'll find it easier to learn the next one, which can be Rust :-)
Started learning rust 3 days ago. This video couldn't have come at a better time!
Wonderful! It'll be hard sometimes, but stick at it and watch my Rust series for inspiration :-)
One thing that I think is especially difficult to learn is working around the borrow checker, but even more importantly, knowing when you shouldn't work around the borrow checker.
When I just started learning Rust, I had worked on a project where my design didn't really work well with the borrow checker at all. No matter what I tried, it wouldn't compile. At the time I remember being extremely frustrated with Rust, however in hindsight I now see that the reason the borrow checker didn't like my code is because it wasn't well-designed. I would have saved so much time if I had just planned ahead and come up with a design that didn't have circular dependencies. Even in languages without a borrow checker, designs like that will eventually be your downfall - I've had many projects devolve into an unmaintainable mess due to poor planning.
Basically, while I didn't realise or appreciate it at the time, Rust's design was pushing me towards better software design from the get-go.
That's a really great take and one I was helping a patron I'm mentoring out with. Tree structures are REALLY easy to reason about so long as they don't have cycles! Nice!
That kind of inversion can be really useful, though, like when parents know about their children, but children also know about their parents. It can be done in roundabout ways, but they may be more prone to other kinds of programmer errors than simply allowing that kind of relationship.
I fell in love with rust when i ran the complier the first few times and it gave advice for my code.
something about the complier enforcing preemptive/preventive coding habits just clicked and showed me that this was a language made by experienced teachers and I'd have a great time learning rust, and even how to code
I'm glad I found your video. I believe I was learning Rust the wrong way. Going to follow your advice.
Everyone kept telling me to not learn rust as my first program Language. And from all the online help I can fully say.
Its hard but dont give up and dont listen to the haters
nice!
You can learn rust as your first language and if your primary goal is to make stuff with rust, then do that. But if the goal is programming in general then choosing something easier first is good to avoid frustration
@@theroboman727 I'm learning it to get a GF.
I heard Rust devs get the most Women
I completely agree. I have a similar graph that shows complexity and scale at 7:29. By placing the right tech in the right place, you can flatten the inevitable complexity curve and dramatically increase velocity, which improves both the quality and speed of delivery.
The thing I find most awesome about Rust is that if it compiles, the program works flawlessly almost EVERY SINGLE TIME. As a game programming hobbyist, I can honestly say I made more progress in a mere 3 months with Rust (while learning it on the fly, no less), than I had in the previous 3 years using C.
YES! I adore this feeling so much, my life is so much more relaxing!
RUST IS BORING: th-cam.com/video/oY0XwMOSzq4/w-d-xo.html
Which game engine do you use?
@@zhenia0zuser I'm interested too, I've been very impressed with Bevy
@@zhenia0zuser I mostly use Bevy now, but I learned Rust by working through Herbert Wolverson's Hands On Rust book.
@@zenshade2000 Which one was with C?
This is one of those videos where I will watch multiple times so I can open all the resources and save them. Thank you great video!
My pleasure! Check out my other videos for more exciting Rust features!
Went from py and some JavaScript to Rust and it was kind of fun working through the rustlings. Didn’t think there would be a whole bunch of new concepts to learn
It's a very good language!
JS developer here, great analogy about JavaScript, it feels like you never stop learning it at times... 😒
I mean, we're all js developers really - no-one can escape! XD
(though I'm hoping rust and webassembly and maybe something like yew.rs can help me!)
I must say - words "Rust isn't difficult, it's unfamiliar" completely changed my perspective and motivated me to finally learn Rust. I was bouncing from it 3 times, but now - thanks to this - I know I will succeed. It's hard to leave my JS comfort zone, but it's the right thing to do. 😊
Thanks for another excellent video. I’ve also found Rustlings to be pretty much best-in-class for that sort of learning tool, but didn’t know about the Brown edition of The Book and am looking forward to checking that out.
I'm learning RUST by myself from 1year, today I fully understand Sender Receiver of thread and Arc Mutex. I think I'm not talented but Rust itself cross the line ABSOLUTELY IMAO.
@@inmonolife8361 It’s motivating for newbies like me. Thanks
Sir, I am currently learning Rust, lifetimes had me stressed out for weeks! Thanks for being indulgent about it in your video, it makes me feel like I can still work with Rust not using lifetimes every single time and will eventually learn how to use them anyway!
I fully agree with the "No references only copying" tip. They way rust handles solves the memory management problem is by a logical enforcement and tracking of move semantics (By using the abstraction of 'Borrowing'). If you are a C++ developer. Move semantics are one of the most complex advanced topics that you will have to deal with. Having rust developers have to worry about that from the start is madness. Specially when they come from high level languages and they don't even know about pointer or "The heap"
It's MAYBE not quite "madness" but it is EXTREMELY CHALLENGING. Worth it, but oof!
What I learnt in Rust(I did study borrowing): If red squiggly line, use &, if fail, use unwrap(), if fail, use expect()
this is the way! 🤣
(though you forgot "if & fails, use &'static")
The problem with cloning is that you will lie awake at night thinking about how your could remove it. Even if it barely affects the performance of your code. I have one problem I've been stuck on for 3 years where I wanted my function to take in an iterator and return an iterator, rather than having to collect() it into a vector. Problem is along the way a new struct gets created that the resulting iterator must hold as a reference. Tearing my hair out about how to make that struct live long enough.
This is the perfect problem to post on my discord in #programming - there's lots of smart nice people who might have ideas for you! :-)
Rust is the first language I ever used that makes so much sense
I enjoy how it makes you write good code
Absolutely agree!
Great video as always.
I'm always talking about Rust to developers.
The learning curve is always a turnoff, but I often explain (as you do) that it's steep, but flattens of rather quickly.
The other worry is having to worry about things they didn't used to, so I also suggest they can go really deep with memory concerns, or just ignore that, clone everything, and worry about performance later. Inevitably, they're already picking up using references before it ever gets to a performance issue simply because they're modeling their problem more correctly now.
So this video is rather validating for me.
me too!
2:04 I tried to buy the book but the shipping was 3x the book's price, so I went with the electronics
copy... The best book I ever read about some programming language(still reading it and I am reading it whenever I have a few minutes to spare)! Thank you for the great video ❤
Keep it up 👌 🎉
I'm delighted for you! Also, something I forgot to mention in the video, ALL the books are available offline with every rustup installation, just run `rustup doc` GORGEOUS!
I must say you're quite clever. Rendering your videos at 6 fps allows for viewing higher-res graphics without using up too much bandwidth.
Well spotted! It's actually even cleverer than that - I export my videos from Reaper at 2fps, this means I can render at about 40x realtime, meaning my turnaround time for video edits is EXTREMELY fast. Additionally, upload times to youtube are next-to-nothing, and I even feel like youtube's processing time is much faster, due to this tiny file size!
4:30 What you talk about here is a concept I discovered while learning to do various creative things digitally. Knowing what is possible first is a major key to learn MUCH faster. I had watched photoshop videos for years up until I finally pirated it in 9th grade. Took me little to no time to learn the tools 1 by 1, and pretty soon I was making decent edits. And now, about 2 weeks ago I took a photo of myself for my LinkedIn, and noticed some tape on the wall behind me. Because I took the picture in my room and I have sheets of paper with plans and stuff hung up to keep me in the right headspace. In like 5 minutes I had a perfect wall behind me with 0 blemishes of any kind, my hair was not messy at all and my suit jacket had no lint on it.
Fantastic! This attitude will help you learn anything you want in life :-)
excellent vid. I appreciate the Haskell point for learning :) and especially appreciate the advice to avoid ref in favor of ownership and copying until the compiler pushes you.
Haskell was a great thing to learn early on in my career
Just found your channel, and this video is great!! Going to watch your previous videos and waiting for the next!!
Thank you very much! I've put all my rust content into a playlist th-cam.com/video/Q3AhzHq8ogs/w-d-xo.html
This guy is a perfectionist in making his videos.. 👏🏻👏🏻👏🏻
Thank you!
You wouldn't *believe* how expensive the microphones I'm looking at buying are XD
Don't be a perfectionist, kids!
9:55 When I was new to Rust, I didn't fear using references, even if they had lifetime annotations. Now, years later, I try to avoid explicit lifetimes alltogether and only use them if there is no chance to avoid them.
But there are a few cases where I really want lifetime annotations, especially in structs. Normally when I want some kind of accessor to some data, which should not be modified or go out of scope as long as the accessor exists.
For example I used this to call some function safely. Calling the function is only safe if I specify a valid parameter. So instead of calling the function directly, I created a struct, which lists all valid parameters, and in order to call it, I only specify the index of the parameter I want to call.
But iterators are also a good example for this.
Many thanks for this.
While I'm well into my second year with Rust and able to leverage fasterhanlime's projects, I am still rather slow when coding and fixing compile-time errors. Therefore: repetition and muscle memory are key!
Fantastic, you're not too far behind me, I'm learning every week too :-)
Good vid, I started using rust about a month ago. My biggest issue still is learning more complex lifetimes. For example, the winit library uses a move closure for its event loop. This seems to create issues with 'static lifetimes and took me several days to fix. Ended up using a combination of Rc and Cell to create what feels like a hacked solution but it works.
That's a challenge for sure. You're operating much beyond the beginner recommendations in this video.
I bet you know what is happening with your code FAR more than if you built it with a language that just magically handled things for you. Scaling will be easy for you!
I'm an R guy, but you make Rust sound very appealing. It would be exciting to see you cover the Polars library sometime!
Polars looks cool! I'm not in the stats/data world, but I'll keep it in mind for a future video!
I can only hope you can deal with the possible Stockholm Syndrome and escape the R community; that language and ecosystem is a great example of exactly what CS is trying to leave behind with these next generation languages (I say this as someone who started with R).
Thanks for the tips. I'm some chapters into the book already, and I was worried to follow your advice I'd have to start over. I'll keep charging through like I have been and then check out rustlings the second time. Thank you!
const THE_BOOK = 'The Rust Programing Language Book'
I like how he used a verbal variable for THE_BOOK.
I stopped learning rust in jan then last month i picked it again and finally finished the book, completed rustlings.
Now I'll do rust by practice and advent of code with this
YES, great news. I started and stopped a few times, you're in for a TREAT
Thanks for the Ultralearning recommendation! Nothing excites me more than a good book recommendation.
Also, I'm going rusty because of you. You are a sneaky crab making everyone rusty 😂
fantastic!
Started to learn it because of you and have to say it's been awesome! Thanks
Fantastic!
Great video as always! You're probably the best spokesman Rust has at the moment.
Thank you very much! I'm trying!
8:39 this is the best view I've heard about the purpose of lifetime annotations. Prior, I never thought lifetimes like that. Cheers NB, for making concepts easy to explain.
My pleasure! I took most of that info from The Book, so I can't take all the credit :-)
This is probably your best video so far. Everything mentioned in this video is something I experienced while learning Rust. I think this is a valuable resource for new Rust developers who want to learn the language.
Thank you so much! The numbers certainly agree with you!
I started my programming journey with Python, and I still love the language for its simplicity and its ability to set things up and going. Then I heard about Rust, about how memory safe it is. It is a big step up, code seems harder to read at first. But the more I read, break down the syntax to understand what it does, I found clarity in Rust, it's predictable, it does what you tell it to and just you, or it can refuse to compile straight up, it wants you to be precise, and that has been the thing driving me to keep learning it.
It's been a long time since I started learning Rust, and I sure wish your video was available back then!
Great summary of what to do to learn it, and the approach to lifetimes is exactly what I did (skipping the cloning).
People who say Rust is difficult are just too used to fail at runtime.
You could've also talked about unwrapping, and why it's a great tool for the developer to know what points of the program can fail.
Great video, keep up with the good work!
Thank you! I did a whole video on unwrapping, do check out the whole playlist! th-cam.com/video/sbVxq7nNtgo/w-d-xo.html
No Boilerplate: *Explaining how to learn thing faster*
Me: woooooooow eyeball compilerrrrr Coooool.
You didn’t mention the version of the book with little quizzes mixed in! That’s how I went through it and being “forced” to understand stuff before moving on worked pretty well for me!
I actually did, check again!
4:52, very happy to be wrong on this. 😊
the "simple things are easy, complex things are possible" hurts on a personal level. that's one of the reasons i want to learn rust.
Rustlings is phenominal, get 'em installed!
Struggling with so much, rust is very alien from what I'm use to which makes it very exciting to learn for me.
I read right though the book quickly, and built some basic apps putting that knowledge to test.
Fantastic, have you seen my Rust series? Here's the playlist th-cam.com/video/br3GIIQeefY/w-d-xo.html
great video as usual! did not expect to see a reference to haskell in a video about learning rust! that was a surprise! but a very good proposition.
i'm in the process of learning rust after many years of being a professional js developer, while i'm still far away from being able to do any significant functionality in rust, i'm starting to really understand and appreciate its syntax and the benefits that come along with it. funnily enough, the concept of borrowing and ownership was probably the least complicated thing for me to understand, it was a lot more about traits and enums and all those things since i never really had much experience with typed languages.
Looking forward to a future filled with many rust jobs and no more javascript pain.
What a dream! Do check out my 'space station' video for advice about enums, if you still need help there!
Best of luck with your learning! Trust me, learning Enums will be worth it, I can't look at Enums in any other language the same way ever again
@@miguelguthridge @no Boilerplate Thank you both
Wow ! I was about to search "How To Learn Rust" and youtube recommends me a video that has the exact same title what I was about to search and thanks for the video as it was quick and on point.
amazing, thank, you!
Here is my dilemma: Yes rust is cool, and it can be fast, and it can be elegant etc. But in the real world, the C# JIT is so good that often the c# version of my app is faster than the rust version. Because all this added complexity nukes my ability to build the abstract ideas in my head first and just type them out. Now all of a sudden I have to have this hierarchy of ownership that locks down my architecture. If I discover a problem and need to redesign, it often breaks the entire ownership chain and requires me to basically start again. In C# I just change it, and the JIT does all that work for me
though you cant deal with unpredictability of jit, after you refactor some things in c# you never know how fast it will be, and with rust you almost certainly know it would be al least as fast (with some exceptions ofc)
I've been stalking rust for awhile. What I've heard the hardest part to learn is when the compiler is right and tries to guide you in the right direction vs when it's wrong and knowing the tips and tricks to guide it.
That's a reasonable thing to say, once you get past intermediate rust and start getting into the master-tier, the error messages are not as friendly. They're not *wrong* but they are no longer as helpful.
Every single release (every 6 weeks) the core team improve the errors, so by the time you reach this stage, 1. The errors will be better 2. you will already know how great the language is and be happy to figure things out.
I'm drafting a video on how to talk to the compiler (ie read errors easily)
@@NoBoilerplate Thank you for taking the time to reply! And that makes sense, I'll probably try my next project in rust.
A bonus motivation: AI doesn't know how to write rust yet. It tries, but it mostly fails. It might take it longer to learn it, so rust jobs will be safer for that much time.
Heh, that's not been my experience, copilot works great!
@@NoBoilerplate My experience is with ChatGPT, so it's possible we are both right!
Are you sure that you are safe? nothing is safe when AI start to master one of programming language, don't even ignore that what AI can do for next few months.. it is just the beginning
@@zigang93 I'm pretty sure I'm not, that's why programming is not my main focus, but info security and machine learning. I'm just saying that there are languages that need you to have deeper understanding on what's "under the hood", and it will take ai longer to master them.
Or it’s actually easier I’d say. The language is much richer, more exact and precise. And so is every open-source project that compiles. So it’s all there if the machine can read it.
I want to learn rust somewhere in the future, but not as of now.
Still, everytime i see a new video of you, i make sure I can watch it as soon as possible.
Your naration + videos are amazing.
Thank you so much! Perhaps you'd like more of my narration in my scifi series, Lost Terminal? th-cam.com/video/p3bDE9kszMc/w-d-xo.html
You deserve more subscribers. Been watching your videos for a while now and I didn’t even bother to check your sub count or subscribe myself. You make me excited to learn programming each day- even tho I’m not learning rust. I want to get good enough at js and Python to really hate them so I can switch to rust but stay humble.
I'm so pleased! you can of course get a lot of valuable work done in JS and Python, I certainly have over the years, and there's nothing stopping you from learning Rust too! It's not like any of them will be the last language you and I learn, right? :-D
Nah your something else, I just subscribed today and thank you in another video and now you drop in a new rust video. Your awesome!
Thank you!
I have a question: how do I forget rust?
You can't, that's the problem, your life will never be the same, you'll never be satisfied. XD
I've started my Rust journey after watching this video :) Thank you!
You can do it! Keep at it and watch my other videos for inspiration 🙂
The thing about rust, is that I only started learning it a month ago and yet I already feel frustrated, when python, C, C++ or Java (I'm a CS student) does something in a way that Rust solves much cleaner and safer. I'm especially fond of how Rust handles exceptions. It's so much more natural than any other language I've seen
I can't bare to write other languages now, it's so painful.
You can take a look at the "Rust Quick Start Guide---Master Rust Programming Basics" course recently launched by @Tintinland and the co-founder of the Rust language Chinese community and senior Rust developer Mike Tang.
The course starts at the end of June. You can gain a deep understanding of the core concepts of Rust, develop simple Rust code independently, and get accompanied learning by technical experts. After the course is over, there will be job postings~ I have signed up!
I've been trying and failing to learn how to code for the last 2 years because I constantly tell myself that i will learn something else to make learning Rust easier, my intentions are more for a hobby standpoint as I'm more oriented to the SysAdmin\Cloud Architecture side of things, but this has motivated to start giving Rust a try (with patience) from the get go.
You can do it! Watch my other videos for inspiration, and come chat on my discord (link on my website)
Somehow, Rust seems best or at least great for any use case at all. Many languages are marginally better when the problem is tuned in the right way, but focusing on Rust just seems a great move career- and life-wise as a developer.
I absolutely agree!
As someone that has fallen off the rust bandwagon for the exact same reasons listed in this videos, this was very helpful. Also having some experience writing functional code with typescript and fp-ts, many of the functional concepts in rust become obvious and appreciated. Will be giving it another try
If you need a boost, have a look at my other Rust videos :-)
Could you do a video on your NeoVim config?
Vanilla Astronvim! astronvim.com
Good video, I seem to have stumbled into many of these things already by luck and there were new bits of advice. Thanks for saying I can copy and clone everything, validating for now. :)
That's great to hear for me too! I'm only 90% sure, and if I hear any better ideas, I'll add them to the ERRATA comment!
50 people startup sounds like a business with a mid-life crisis.
I'm getting started in the programming world with Rust and I'm really enjoying the experience!
After many months of listening to you evangelism, I have finally set aside a serious block of time to go through the Rust Book. Currently on chapter 7.
I hope that you find time to make a video about how Rust approaches modules/submodules, public versus private stuff, paths, etc. The book itself uses this... utterly bizarre restaurant analogy that just baffles me
Hehe - try Rust By Example - much better single-and-multiple file examples of modules there.
But I'll make a video on it soon!
Good one.
Many Thanks for sharing your knowledge and experience.
This hobbyist gave Rust my best efforts but gave up. Now keen to try again. Will definitely be using your suggestions. Thanks again.
It's ok to give up and try again, as I did! Do watch my other Rust videos for inspiration, there's a LOT of exciting stuff here! Start here th-cam.com/video/oY0XwMOSzq4/w-d-xo.html
@@NoBoilerplate Many Thanks, Tris.
Yeah, giving up and trying again is pretty much my standard MO, for lots of things. :-) I get bored if stuff is too easy LOL.
I already had 'The Book' so quickly reading that again. Up to end of chapter 6 and kind of surprised at how much sense it's making. Must be remembering more Rust than I thought I would. Also picked up a copy of Ultralearning which is proving very interesting. Will be checking out more of your content for sure. Thanks again and Good Luck with all that you're working on
@@samdavepollard thank you! Do come and say hi on my discord if you like!
I love the rust propaganda. Am with ya! 🔥
Welcome to the Cargo Cult!
i am completely sold, i will do this after ive finished my bachelor thesis in 2 days. the free time after is heavily dedicated to learning spanisch and rust, 2 languages at the same time i guess.
make a little flash cards command-line app!
@@NoBoilerplate That is an really great idea. Thanks a lot.
This video is not endorsed by The Rust Foundation™
It's too soon to judge.
Something I learned while working in the UK Government's digital department was not to worry too much what the lawyers and politicians are doing, they do and say insane things every single day.
And guess what: It doesn't really affect us very much down here, on a long enough timescale.
In a year they'll be long gone, and we'll still be here, building the future.
My attention is finite, I choose to use it on more interesting things 😄
@@NoBoilerplate report as spam comments
I only learned lifetimes properly once I began messing with it, wouldn't recommend running away from it for too long. This time I stuck with it, insisted on having a borrow value instead of another method to force myself to deal with the problems, I ran into a lot of problems, had to rewrite a bunch of stuff multiple times, but I get it now. What really clicked for me this time how borrowed values must *outlive* the borrower, that somehow never registered in my head as I was learning before, everything became clearer after that.
I don't enjoy how easy it is for me to believe everything you say hahah
I'm trying to use this power for awesome, not evil :-D
If you want to hear me in a different context, I have a scifi story podcast I'd love to know what you think of th-cam.com/video/p3bDE9kszMc/w-d-xo.html
I started developing a complex Rust wasm project with all the juicy bits and pieces of an underdeveloped ecosystem at work head-first with little to no Rust experience months ago.
And I learned one crucial thing:
Rust's, both referring to the language and the community, focus on precision, correctness, and stability makes a 0.2.4 Rust library more reliable than some 2.x libraries I've experienced somewhere else.
It's magical how productive I am with all the betas I use.
Right! I trust rust alpha software more than anything on NPM!
The hesitancy to go 1.0 in Rust comes from the requirements of semver versioning. 1.0 means you can no longer make breaking changes to the API, without bumping the major version. 0.x means "I'm not ready to guarantee to stable API yet." It says nothing about reliability or even completeness.
don't like to do.. "first"
but maybe I am.
My errata comment is always first :-D