Code Blocks in Ruby

preview_player
Показать описание
How to use Blocks, Procs, Lambdas, Iterators, and Callbacks in Ruby.

Рекомендации по теме
Комментарии
Автор

You've saved my sanity, please post more ruby tutorials!

warci
Автор

My mind is exploded but in a good kind of way. Thank you so much!

isaacchuah
Автор

Very useful video. I finally understood the difference between Procs and Blocks.

BangaloreGuy
Автор

This is amazing stuff, to say the least. I was ignorant of how much Ruby can simplify a coder's life. I am beginning to think differently about solving coding problems after this. Would love to see more videos from you Alex!!

mohammad
Автор

You helped, thank you for such an awesome video

dencam
Автор

You are just plain AWESOME! Thank you for the great video!

CharlesDeBarros
Автор

Amazing, thank you so much for sharing! This helped a lot

MrRhysSir
Автор

Thanks by your class is very helpful to me

FranciscoJavierLariosSoto
Автор

Great videos. Lots of good examples. Next time, repeat the question when someone asks one.

snowpunk
Автор

Yeah, sorry about that! This was an experimental recording so the crowd wasn't miked.

possibledog
Автор

Ruby is very expressive, it's sad that it had lost the war against other scripting languages in web development.

dmitriyobidin
Автор

Awesome video it is.. I understood a lot from it. Expecting more on the same topics if you have. :)

aruprakshit
Автор

curlybraces blocks have a higher priority in MRI

shadyjeweller
Автор

Yes, curly braces have a high priority, which means that if there are (explicit) parameters to the function, you should probably use parentheses around the arguments when you call it if you're using braces. "do" is cleaner (same with not, and, or vs. !, &&, ||).

possibledog
Автор

I love you! lol in a brotherly way of course

makerKID
Автор

don't the curly braces also have a higher priority?

Armoterra
Автор

Just to add a refactoring comment. Use { } when you only use one instruction in the block. Use do...end when your block will use more than 1 instruction. In fact the example around minute 12:50 could read nicer like this `twice_do( proc { puts "hi" } ). It is less verbose and easier to read.

abraham