No video

Common Programming Concepts in Rust

  Рет қаралды 97,876

Let's Get Rusty

Let's Get Rusty

Күн бұрын

The ultimate Rust lang tutorial. Follow along as we go through the Rust lang book chapter by chapter.
📝 Get notified when the Rust Cheatsheet comes out: letsgetrusty.com/cheatsheet
The Rust book: doc.rust-lang.org/stable/book/​
0:00 Intro
0:25 Variables & Mutability
3:52 Data Types
7:45 Functions
10:05 Control Flow
13:45 Comments
14:04 Outro
#letsgetrusty​ #rust​lang #tutorial

Пікірлер: 116
@letsgetrusty
@letsgetrusty 3 жыл бұрын
📝 Get your *FREE Rust cheat sheet* : www.letsgetrusty.com/cheatsheet
@braylondominick5304
@braylondominick5304 3 жыл бұрын
I guess I am kinda off topic but do anyone know a good site to watch new tv shows online ?
@kanekarter1249
@kanekarter1249 3 жыл бұрын
@Braylon Dominick Flixportal :)
@braylondominick5304
@braylondominick5304 3 жыл бұрын
@Kane Karter Thank you, signed up and it seems like they got a lot of movies there :) Appreciate it !!
@kanekarter1249
@kanekarter1249 3 жыл бұрын
@Braylon Dominick you are welcome xD
@veekthorcodes
@veekthorcodes 6 ай бұрын
just when you set subscriber count to 100k and said we can all dream, looking at the actual count rn, your dream came through :)
@marcinkondrat1414
@marcinkondrat1414 Ай бұрын
I've just looked in the comments to see if someone's already commented this
@Joel-yp4yt
@Joel-yp4yt 3 жыл бұрын
People might criticize following the book, but it's really helpful to have this in video/audio format to reinforce the lessons
@antonpodkur3520
@antonpodkur3520 2 ай бұрын
Agree, also Bohdan has very good implementation
@soldadonieve8764
@soldadonieve8764 3 жыл бұрын
So much more approachable than the book on its own. Def appreciate your content.
@letsgetrusty
@letsgetrusty 3 жыл бұрын
Thank you Raul!
@ezwalduzumaki3161
@ezwalduzumaki3161 2 жыл бұрын
@@letsgetrusty I agree, love reading a chapter and following up with your videos, super helpful honestly, especially when trying to consume such complex knowledge.
@kahnzo
@kahnzo 2 жыл бұрын
Sweet. Working through the book now.
@tobi9648
@tobi9648 7 ай бұрын
now, 2 years later, your dream of 100000 subs almost came true....great job!!!!!!! I love your videos!! would be nice to now how many subs you had when you published this video :-)
@ilyasssaadi9594
@ilyasssaadi9594 2 ай бұрын
115k now
@thingsiplay
@thingsiplay 3 жыл бұрын
3:07 Another difference between `let` variables and `const` "values is, that you cannot shadow constant variables/values (or am I wrong here?). That gives an additional security that you don't accidentally redefine its value.
@letsgetrusty
@letsgetrusty 3 жыл бұрын
That's right!
@thingsiplay
@thingsiplay 3 жыл бұрын
@@letsgetrusty I want to add another note. Sometimes initialize the variable with `let mut new` and then later redefine it as `let changed = new`. - The name change has the benefit of making it clear in the document we are using a changed state of the initialized variable. Just a little bit more readable at times. - But most importantly the mutability changes. Now the best part of it: If the variable/struct or whatever object it is does not implement the copy trait, then no new space is allocated. The ownership is just transferred and the benefits like changing mutability comes for free.
@KleptomaniacJames
@KleptomaniacJames Жыл бұрын
Well constants don’t exist past compilation
@productivewallace
@productivewallace 3 жыл бұрын
Best rust tutorial I’ve ever seen. Period!
@vanillaface6097
@vanillaface6097 2 жыл бұрын
I've been doing rust in non professional setup for a while and I watched advanced videos of LGR and learned a lot of stuff I didn't know about traits/smart pointers/error handling. I said "surely I won't learn anything from basic control flow video here" - and I learned that break from loop can actually return... So far, I keep finding gems in every video, no matter how basic.
@foobar1269
@foobar1269 2 жыл бұрын
Thank God the if statement only looks for boolean. In Ruby the if statement can be boolean, numeric, nil and I have seen crazy codes in the if statement where a function is used and the function can return any 3 variations of bool, numeric, or nil. It makes it extremely difficult to read the code and convoluted. I love how in Rust it is explicit boolean.
@isaacnaughton5206
@isaacnaughton5206 11 ай бұрын
Quick tip on for loops over ranges at 13:25. If your use case requires the last value to be included, you can do 1..=4
@bharatnanwani
@bharatnanwani 7 ай бұрын
Amazing! No nonsense. Covered all the basics in one short video. Excellent video.
@eduardrivas6964
@eduardrivas6964 2 жыл бұрын
This is awesome, I'm non-native-english person, so reading the book and having somebody explaining some things in voice is a really good support. Keep it up man! Great job!
@gabrock55
@gabrock55 8 ай бұрын
Watching this and seeing you smile when you say "we can all dream" after setting Subscriber count to 100,000 and looking at your subscriber count sitting at 93.5k gets me so stoked for you! You'll be getting there in no time Bogdan! Keep up the amazing content, watching through this playlist has taught me so much. Thanks for teaching everything so clearly!! Cheers :D
@PreRenderedRealities
@PreRenderedRealities 3 жыл бұрын
This series is insanely helpful, thank you so much.
@santhanamss
@santhanamss 3 жыл бұрын
Great videos, really good pace and full of useful extra information.
@joelmontesdeoca6572
@joelmontesdeoca6572 3 жыл бұрын
Keep popping out quality tuts and you'll reach 100,000 subscribers for sure! Thanks for the great tuts. One thing I was wondering tho, would it be possible to add chapter numbers the the vid titles?
@letsgetrusty
@letsgetrusty 3 жыл бұрын
I will consider this. Thanks for the feedback!
@rahulsaxena5015
@rahulsaxena5015 6 ай бұрын
Man just hit 100k subs. WILD!!
@nathanielwoodbury2692
@nathanielwoodbury2692 Жыл бұрын
freaking unreal level of teaching abilities. I am honestly speechless by how easy it is to understand your way of speaking / teaching lol
@Kyle-rf5mb
@Kyle-rf5mb 11 ай бұрын
Really liking these videos, i hav ethe book but sometimes after coding all day at work i cant focus as much so just following along with the videos helps and once i start i get into it again. Thank you
@freeweed4all
@freeweed4all 2 жыл бұрын
These videos are gold. Thanks for your work!
@bhavikpunmiya9641
@bhavikpunmiya9641 Ай бұрын
Thank you for this tutorail, tried running loop in different languages rust is way faster than every other languages !
@jabuci
@jabuci 2 жыл бұрын
I love this series. Thanks!
@JSWarcrimes
@JSWarcrimes 8 ай бұрын
"100k subs. We can all dream." Well, you are getting close to it, bud. Thanks for the series!
@Nerpson
@Nerpson 3 жыл бұрын
Great series so far
@tonyczajka6694
@tonyczajka6694 2 жыл бұрын
Awesome video man, very helpful!!
@TarasShabatin
@TarasShabatin 3 ай бұрын
Now you have more subscribers than you've dreamed of :)
@mihunt3r929
@mihunt3r929 3 ай бұрын
Thank you very much. Your content is great. It is much more fun to watch videos than to just read the book
@licriss
@licriss 2 жыл бұрын
Hit with the question just after I asked it in my head, subbed
@gautamprikshit1
@gautamprikshit1 2 жыл бұрын
Well I don't know how to say it but thanks for existing and making this series I was looking for it I hope I'll see some real rust projects on channel too that'll be helpful
@guidogiuntoli4184
@guidogiuntoli4184 2 жыл бұрын
Great videos! Thanks a lot for this content!
@fishermeng8111
@fishermeng8111 Жыл бұрын
really clear and help video
@256k_
@256k_ 2 жыл бұрын
i really appreciate you taking the book and converting it into video format, i have a hard time keeping focus when reading programming books and much better learned when i can "hear" & "see" something rather than "read" it. a bit ironic given programming is all about reading and writing code, but 🤷‍♂️
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars 9 ай бұрын
this was good, thank you :)
@exoticcoder5365
@exoticcoder5365 3 жыл бұрын
Very Useful Thank you
@superfortekiai
@superfortekiai 9 ай бұрын
Your explanation is very good, congratulations for creating this channel
@pavanadhitya6028
@pavanadhitya6028 6 ай бұрын
Short Summary for [Common Programming Concepts in Rust](kzbin.info/www/bejne/aIeTe5SDi8-trdU) by [Merlin](merlin.foyer.work/) Title: Understanding Basic Programming Concepts in Rust [00:02](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=2) Chapter three covers basic programming concepts in Rust [01:50](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=110) Constants in Rust have key differences from variables [03:38](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=218) Scalar data types and integer overflow in Rust [05:29](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=329) Rust supports floating point numbers, booleans, and character types. [07:13](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=433) Using vectors and array indexing in Rust [09:02](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=542) Returning values from a function in Rust [10:50](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=650) Different types of loops in Rust [12:44](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=764) Use 'for' loop to iterate over arrays and ranges --------------------------------- Detailed Summary for [Common Programming Concepts in Rust](kzbin.info/www/bejne/aIeTe5SDi8-trdU) by [Merlin](merlin.foyer.work/) Title: Understanding Basic Programming Concepts in Rust [00:02](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=2) Chapter three covers basic programming concepts in Rust - Variables in Rust are immutable by default, to make them mutable, use 'mut' keyword after the let keyword. - Rust also has the concept of constant values, which are created using the const keyword. [01:50](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=110) Constants in Rust have key differences from variables - Constants cannot be mutated and must be type annotated - Constants can only be set to constant expressions and have more readable numeric literals [03:38](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=218) Scalar data types and integer overflow in Rust - Scalar data types in Rust include integers, floating point numbers, booleans, and characters. - Integer overflow results in two's complement wrapping, with values greater than the maximum wrapping around back to the minimum value. [05:29](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=329) Rust supports floating point numbers, booleans, and character types. - Floating point numbers are numbers with decimal points and have default precision of 64 bits. - Booleans represent true or false values, and character types represent Unicode characters. [07:13](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=433) Using vectors and array indexing in Rust - Accessing individual values within an array using standard bracket syntax - Rust prevents out of bounds exceptions and memory unsafe behaviors by knowing the size of the array [09:02](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=542) Returning values from a function in Rust - Rust allows returning values from a function using the return statement. The return type can be specified after the parentheses by using a dash and an arrow, followed by the desired return type. - Inside a function, the last expression is implicitly returned. An example is shown where the return keyword is removed, and the semicolon is omitted for the last expression. [10:50](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=650) Different types of loops in Rust - The basic loop created using the loop keyword executes the code until the break statement is called. It can also return values from the loop. - The classic while loop executes as long as a certain condition is true, and the for loop is useful for looping through a collection. [12:44](kzbin.info/www/bejne/aIeTe5SDi8-trdU&t=764) Use 'for' loop to iterate over arrays and ranges - Iterating over arrays using the 'for' loop and printing each element. - Using the 'for' loop to iterate over a range of numbers and printing them.
@ArsenGuzhva
@ArsenGuzhva Жыл бұрын
Богдан, ти молодець!
@elimgarak3597
@elimgarak3597 3 жыл бұрын
Subscribed!
@user-yd3fq2ce7t
@user-yd3fq2ce7t 5 ай бұрын
Thank you for the video.
@jonathanmoore5619
@jonathanmoore5619 3 жыл бұрын
Good lad. Thank you.
@jR-tm3ko
@jR-tm3ko 2 жыл бұрын
Great vid!!!!
@ksnyou
@ksnyou 3 жыл бұрын
Thanks to ur vid! I am getting rusty :)
@orhalimi
@orhalimi 3 жыл бұрын
Great stuff
@nofeah89
@nofeah89 11 ай бұрын
Guys, I rarely read books and have web dev background, I think the rust programming book is pretty good. Definitely these videos are also a great resource.
@austttttttt
@austttttttt 2 жыл бұрын
You sir are a legend :)
@techbytefrontier
@techbytefrontier 5 ай бұрын
You have more then 100k now, congrats!
@sajjad7818
@sajjad7818 Жыл бұрын
Wonderful
@SignorZukini
@SignorZukini Жыл бұрын
Nice clear videos at the right pace for noobs like me. Thanks!
@kamurashev
@kamurashev 2 жыл бұрын
💕👍 Thanks for video!
@osheagalen
@osheagalen 3 ай бұрын
watching this and your subscribers are at 114k congrats and thanks for the awesome content!
@nhanguyen2023
@nhanguyen2023 2 жыл бұрын
Thanks a lot ^_^
@yogsharma7807
@yogsharma7807 3 жыл бұрын
Very nice video of nice playlist, bro you can think of this as your investment coz as rust finds more popularity you will surely get noticed. Cheers !!
@letsgetrusty
@letsgetrusty 3 жыл бұрын
That's the plan!
@kayderl
@kayderl 2 жыл бұрын
Hey buddy, what plugin are you using that is helping you to declare the variable type?
@murielgonzalez
@murielgonzalez 8 ай бұрын
Getting pretty close to 100k subscribers :D +1 to everyone's previous comments. It's been super easy to follow these tutorials along with reading the book.
@riteshsharma9838
@riteshsharma9838 Жыл бұрын
what extension are you using in vs code for rust using that you getting full details of the each datatypes and its features, just like for html css MDN reffrence is recommend when hovered would be helpfull if you tell me please
@bruhurb6298
@bruhurb6298 2 жыл бұрын
a question: when looping through an array, what's the difference between `for el in a.iter()` and `for el in a`, because both works and in the Rust book (as of July 2022) it uses the `for el in a` version, without mentioning the `iter()` function
@ocdy-gk9pw
@ocdy-gk9pw 2 жыл бұрын
`for el in a` will loop over a but will also consume a. `for el in &a` is the same as `for el in a.iter()`.
@enclave2k1
@enclave2k1 Жыл бұрын
Making subscriber count a const was depressing. Hope you grow my dude.
@brethagen7776
@brethagen7776 10 ай бұрын
Won't have to dream for much longer, almost there to 100k!
@Khl8122
@Khl8122 7 ай бұрын
1:50 Well, you don't have to dream much longer. As of end of 2023, you have 98.3 K subscribers. Thanks for a great video.
@ilikegeorgiabutiveonlybeen6705
@ilikegeorgiabutiveonlybeen6705 11 ай бұрын
constants might be also (probably?) stored in data segment of the process's memory (i dont know im guessing please correct me if im wrong)
@sweetjimmy
@sweetjimmy 21 күн бұрын
how to change the steps from 1 to a higher value in the for loops using range?
@sayo9394
@sayo9394 Жыл бұрын
great series, thanks heaps for your effort. BTW the link to the The Rust book seems broken.
@k1tajfar714
@k1tajfar714 4 ай бұрын
Rust's the best. thank you budd
@kamurashev
@kamurashev 2 жыл бұрын
I’m watching it just as a hobby as it’s being so easily perceived. I really enjoy the format, how compact and at the same time comprehensive the videos are! High five for the efforts ! … ps The hell with that, this is probably gonna be an unusual comment but I also enjoy your background !
@sahilverma4077
@sahilverma4077 3 жыл бұрын
awsome
@planetblix
@planetblix 7 ай бұрын
I read and practice the chapters in the book then I come here to reflect and hear another perspective.
@hilawes
@hilawes 13 күн бұрын
if you're reassigning an immutable variable and even changing its type through "shadowing", then how is it still immutable? I can see if you were doing shadowing inside of a function but we're able to redefine the top line declarations. Confused because it doesn't seem like strict typing and potentially not memory safe.
@johetajava
@johetajava 2 жыл бұрын
What a beautiful language!
@natanfurman2467
@natanfurman2467 Жыл бұрын
Halfway to 100k
@sweetjimmy
@sweetjimmy 21 күн бұрын
are there only two compound data types in rust? tuple and array?
@Uppers101
@Uppers101 5 ай бұрын
Hi I'm coming from python, It's kinda weird that at 12:00 you have to "return" or in your case "break counter" to return the counter assigned to a new variable "result" couldn't you just break, and println!("The result is {}", counter) Seems like overkill.
@dmytrobortnichuk8501
@dmytrobortnichuk8501 2 жыл бұрын
Цікава ідея, екранізація туторіала, лайкос :)
@MobiusCoin
@MobiusCoin Жыл бұрын
Weird to come from JS, I tend to think about tuples as a convention for arrays instead of a different kind of data type. Also arrays with variable length and fixed length arrays as different is also weird.
@rotteegher39
@rotteegher39 Жыл бұрын
4:31 meme flashbacks eeeight beeeet sixeeen beet thirty twooo bit 64 BIT ONE HUNDRED TWENTY EIGHT BIT!!
@Arjun147gtk
@Arjun147gtk 7 ай бұрын
I am getting error in rust 1.75.0 for the below line: let a: [i32; _] = [10, 20, 30, 40, 50];
@elakstein
@elakstein 2 жыл бұрын
No one in the comment section talked about shadowing being bad. I work in legacy c code and the codebase is very big with thousands of line in a function. It makes me anxious about the number of bugs that shadowing of variables can create allowed in the same scope.
@teachingtechnologyy
@teachingtechnologyy 2 жыл бұрын
Lets get Rusty
@headlibrarian1996
@headlibrarian1996 Ай бұрын
It would be really nice if Rust had return type deduction i.e. “fn x() -> auto {…}”.
@silience4095
@silience4095 6 ай бұрын
Congratulations on 100k! Heh.
@akash-
@akash- 6 ай бұрын
finally the sub_count matched the real sub!
@BharadwajAvva
@BharadwajAvva 2 жыл бұрын
The music at the end, I could hear it during the video! Anyone else heard it?
@erwinschrodinger2320
@erwinschrodinger2320 3 жыл бұрын
😎
@letsgetrusty
@letsgetrusty 3 жыл бұрын
🤓
@gataullinrus
@gataullinrus 7 ай бұрын
Эх, Богдан, Богом дан Богдан! :D Спасибо за видео!
@trieuvantunet
@trieuvantunet 2 жыл бұрын
1000 likes for you
@Supercool7042
@Supercool7042 2 жыл бұрын
chapter 3 completed ....
@glennwoe8029
@glennwoe8029 2 жыл бұрын
hi husky
@nathanbanks2354
@nathanbanks2354 Жыл бұрын
Hmm...the video is one year old, and you already have 56K subscribers. You're already more than half way to your dream! (1:50)
@aryansinha1818
@aryansinha1818 11 ай бұрын
Data Types
@rbsfinger
@rbsfinger Ай бұрын
Practicing one video a day to get rusty.
@greatjobbuddy
@greatjobbuddy 2 жыл бұрын
LOL, that's the university district.
@mohitsoni7787
@mohitsoni7787 2 жыл бұрын
in shadowing, how we can use the first variable, for example - let x =5; let x =9; println!("x = {}", x); this is always print 9, but how we can use the first 'x' now??
@uzayrsyed6293
@uzayrsyed6293 Жыл бұрын
Is it just me or why is shadowing a thing?
@not_herobrine3752
@not_herobrine3752 Жыл бұрын
because appearently naming variables quantity_string and quantity_number is le bad
@alienews0
@alienews0 3 ай бұрын
1:44 u want your subscriber count to be a constant ? U like to stagnate ? 😋
@pratikchakravorty983
@pratikchakravorty983 2 жыл бұрын
You can actually just do the for loop without the iter
@krystiangarwol5099
@krystiangarwol5099 2 жыл бұрын
great content but man... these jump cuts all the time are annoying and I basically can't focus on what you're saying :(
@BrianVanderbusch
@BrianVanderbusch 2 жыл бұрын
I've watched so much of this series, and loved every minute. Then I heard you pronounce tuple, and it was so jarring and I instantly forgot everything I've watched. I'm sad that you're part of an enemy faction. I don't even want to know where you stand on tabs v spaces. I don't know if I could stand to hear the answer.
@ctobi707
@ctobi707 11 ай бұрын
well from what i can see rust would definitely never work for game programming
@GeorgeSukFuk
@GeorgeSukFuk 5 ай бұрын
Why does "Let's Get Rusty" have to be typed, of all things, as &str. Literally useful for nothing. How many other string types does rust have now? Ridiculous. So many problems.
Understanding Ownership in Rust
25:31
Let's Get Rusty
Рет қаралды 249 М.
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 159 М.
这是王子儿子吗
00:27
落魄的王子
Рет қаралды 20 МЛН
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 61 МЛН
小蚂蚁被感动了!火影忍者 #佐助 #家庭
00:54
火影忍者一家
Рет қаралды 42 МЛН
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 9 МЛН
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 386 М.
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 298 М.
What Makes Rust Different?
12:38
No Boilerplate
Рет қаралды 200 М.
JPEG is Dying - And that's a bad thing
8:09
2kliksphilip
Рет қаралды 166 М.
Closures in Rust
19:53
Let's Get Rusty
Рет қаралды 75 М.
Tonic makes gRPC in Rust stupidly simple
19:08
Dreams of Code
Рет қаралды 45 М.
Why do developers hate Rust?
8:20
Let's Get Rusty
Рет қаралды 108 М.
Use Arc Instead of Vec
15:21
Logan Smith
Рет қаралды 141 М.
这是王子儿子吗
00:27
落魄的王子
Рет қаралды 20 МЛН