"the compiler is a wonderful tool but it can't read your mind" at 8:05 :D
@haI9k4 жыл бұрын
Hey man, you are doing great job in this tutorial, your explanations are logical and simple unlike some other guys here. Thanks and I wish you all the best. Cheers.
@dougmilford78145 жыл бұрын
Thanks for clicking 'Like' and Subscribing!
@ati43888 Жыл бұрын
Muazzam bir ders anlatış tarzı. Thanks
@antonioastorino74884 жыл бұрын
Pause for a second... I'm making popcorn :) Great videos!!
@MaxVinstappen3 жыл бұрын
I love your videos Doug
@michalbotor2 жыл бұрын
hey doug, what is the difference between `{};` and `{}` in rust? why does this: `{ let v = 1; v };` work but this `{ let v = 1; v }` returns an error?
@Jordan4Ibanez4 жыл бұрын
Hey Doug, in the parenthesis explanation I noticed this: With some_bool == true || (some_int > 100 && some_int2 == 200) it's equivalent to some_bool == true || some_int > 100 && some_int2 == 200. BUT If you do: (some_bool == true || some_int > 100) && some_int2 == 200 suddenly check 1 OR check 2 has to be conditionally correct AND condition 3 has to be correct. But thank you for the tutorial regardless :)
@leoxiaoyanqu3 жыл бұрын
Thanks a bunch for the great series of Rust tutorials! Quick question on the match branch `1 | 2 => ....`, how does Rust handle the case of bitwise-OR vs this logical or? 10:23
@Baron-digit4 жыл бұрын
Hi Doug, great videos, you really help me out here! Just a quick Q: Is there a memory or speed advantage between match and if?
@dougmilford78144 жыл бұрын
I don't believe so, but I'm not 100% sure. If anything it's minimal. The advantage is for developer ease-of-use in my point of view.
@Baron-digit4 жыл бұрын
@@dougmilford7814 thanks!
@kevinwang61883 жыл бұрын
@@dougmilford7814 the compiler will do its best to optimize it in either cases which may result in the same assembly.
@luong87mipec3 жыл бұрын
Thank you very much
@davidhilsabeck4 жыл бұрын
What's up with the diatribe on parens? As a developer you are expected to understand operator precedence, and include only those parens that are necessary.
@Jordan4Ibanez4 жыл бұрын
I also noticed this, with some_bool == true || (some_int > 100 && some_int2 == 200) it's equivalent to some_bool == true || some_int > 100 && some_int2 == 200. BUT If you do: (some_bool == true || some_int > 100) && some_int2 == 200 suddenly check 1 OR check 2 has to be conditionally correct AND condition 3 has to be correct. That's alright though because explaining vs understanding this is different. I'll comment in the main root of this comment section to clarify.
@maxbashyrov57855 жыл бұрын
"if" is not a statement, but an expression - doc.rust-lang.org/reference/expressions/if-expr.html that's why it can return the result of evaluation - doc.rust-lang.org/reference/statements-and-expressions.html