Hey Piyush, thank you for the support! I was just wondering, what do you mean by short tutorials? Do you mean 2-5 mins, 5-10 mins? Also why is it that you like short tutorials? Thanks mate!
Usually, I like around 5-10 minutes, max 15 minutes, as I usually watch during travelling and then re-watch again to try the code. Also, it doesn't over-whelm me to re-watch again as opposed something which is 30min or 1 hour long.
Yeah that definitely makes sense, thanks for the feedback - I'm just trying to understand the audience right now and what people really want out of these videos, thank you!
I'm going to answer this in case other people come here wondering this, I'm sure after 8 months you've moved on from this question. At 5:30, dcode uses a for each iterator loop. This is a language concept that uses the iterator of the collection being iterated over, in this case the HashMap, and turns it into what is basically a normal loop. It is a very straightforward way of visiting every element of a collection, including the option to use pattern matching to bind values to variables, as dcode demonstrated in the video above. The main difference between this and using marks.iter().foreach(|(subject, mark)| { /*code*/}); is that the normal for loop is not a closure, with all the pros and cons of that. Practically speaking both these solutions do the same thing in this case.
Bcz, the for loop owns the iterable if it is not used with .iter() method.. If not used .iter(), we wont be able to use the iterable again after that since for loop gains the ownership of the iterable once it is used in loop without .iter(). This concept is called owenership and borrowing in programming field. Some reading on this will let you get a more clear picture
@@theeagleseye4989 Except if we iterate over a reference instead of course, which is where the borrowing part comes in again. Again though, there are situations where you want one or the other.
Hey thanks for the support - yes I do plan on doing a series on Rust soon and once I get more comfortable with it I'll be creating videos on more advanced concepts.
Seems silly, but what happens to the order of items in HashMap? When you run throw it in a loop, they're coming on screen in a different order every time, if I'm not mistaken
Hi dcode, Can you make a video how to manipulate json as variables in rust. what i mean when i do request. how to extract the data from respond and put some keys in variable then can do some calculation?
You probably figured it out by now: A hash map allows you to access elements by key at constant time, whereas a tuple / vector / array would need linear time for that (though access by index is constant time). They also have some beneficial and some detrimental qualities regarding the way the data is actually stored. Hash maps are surprisingly useful, don't sleep on them!
I'm so happy this exists. This is the best beginner tut playlist I have found, for Rust. Awesome work dude!
its still the best
Good work mate, keep up. I love the short tutorials. Cheers!
Hey Piyush, thank you for the support!
I was just wondering, what do you mean by short tutorials? Do you mean 2-5 mins, 5-10 mins? Also why is it that you like short tutorials?
Thanks mate!
Usually, I like around 5-10 minutes, max 15 minutes, as I usually watch during travelling and then re-watch again to try the code. Also, it doesn't over-whelm me to re-watch again as opposed something which is 30min or 1 hour long.
Yeah that definitely makes sense, thanks for the feedback - I'm just trying to understand the audience right now and what people really want out of these videos, thank you!
That's a great video, thank you. Would you mind to show us how to update a value in the hashmap?
why wasn't .iter() needed here?
I'm going to answer this in case other people come here wondering this, I'm sure after 8 months you've moved on from this question.
At 5:30, dcode uses a for each iterator loop. This is a language concept that uses the iterator of the collection being iterated over, in this case the HashMap, and turns it into what is basically a normal loop. It is a very straightforward way of visiting every element of a collection, including the option to use pattern matching to bind values to variables, as dcode demonstrated in the video above.
The main difference between this and using marks.iter().foreach(|(subject, mark)| { /*code*/});
is that the normal for loop is not a closure, with all the pros and cons of that. Practically speaking both these solutions do the same thing in this case.
Asgar16926 Thanks very much for your effort! I hope this helps people with the same question :-)
Bcz, the for loop owns the iterable if it is not used with .iter() method.. If not used .iter(), we wont be able to use the iterable again after that since for loop gains the ownership of the iterable once it is used in loop without .iter(). This concept is called owenership and borrowing in programming field. Some reading on this will let you get a more clear picture
@@theeagleseye4989 Except if we iterate over a reference instead of course, which is where the borrowing part comes in again. Again though, there are situations where you want one or the other.
subbed, hope to see advanced rust in near future.
Hey thanks for the support - yes I do plan on doing a series on Rust soon and once I get more comfortable with it I'll be creating videos on more advanced concepts.
where di u get Mark from? isnt marks using s?
Why the reference to marks on line 25?
I like the theme you use, could you tell me how to find it?
Seems silly, but what happens to the order of items in HashMap? When you run throw it in a loop, they're coming on screen in a different order every time, if I'm not mistaken
HashMap is not ordered, it just linking a certain key with a certain value.
Hi dcode, Can you make a video how to manipulate json as variables in rust. what i mean when i do request. how to extract the data from respond and put some keys in variable then can do some calculation?
How is a hash map different than a specialized tuple? Is it just the methods you can implement? Thanks for all your hard work. The videos are great.
You probably figured it out by now: A hash map allows you to access elements by key at constant time, whereas a tuple / vector / array would need linear time for that (though access by index is constant time). They also have some beneficial and some detrimental qualities regarding the way the data is actually stored. Hash maps are surprisingly useful, don't sleep on them!
Think i'd kms if i got an A+ in rust programming but failed "professional computing studies". Jokes aside thx for the vid!:D
your name is dom and you are programmer. And one of my professors her name is Nina and she is a nano-scientist what is going on with the world 😂
my uncle is a plumber and he smokes a pipe; like you say, crazy!