Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDavid Forero
5,492 PointsI am having trouble understanding the block concept. It's unclear.
I am having trouble understanding the block concept. It's unclear. Not sure how they work. Seems like Jason is jumping between difficulty levels with in this blocks section.
3 Answers
Maciej Czuchnowski
36,441 PointsYou will get used to it once you write a few methods and blocks on your own and experiment a bit. Here you can do some additional free exercises on methods and blocks: http://www.codecademy.com/courses/ruby-beginner-en-ET4bU/0/1?curriculum_id=5059f8619189a5000201fbcb
(you can jump to exercise 9 if you want, but the first 8 are a good refresher)
Delete Delete
4,001 PointsStruggled with blocks as well, but I found this video incredibly helpful:
https://www.youtube.com/watch?v=K8uhD8mtorE
Little long (30 min video), but solid explanation.
Sulu Fiti
2,940 PointsThanks so much for posting this video. It helped me a lot.
Ginger Bidwell
12,289 PointsI found the explanations in http://docs.ruby-doc.com/docs/ProgrammingRuby/ (and the newer edition as well) to be really helpful for getting a better understanding of some of the concepts covered in this series - including blocks (in the Containers, Blocks, and Iterators section.)
notf0und
11,940 Pointsnotf0und
11,940 PointsThis might help, if you've not already seen it: http://stackoverflow.com/questions/4911353/best-explanation-of-ruby-blocks
Personally, I still don't understand blocks entirely, but it seems to me (and is sometimes explained as) they're essentially anonymous functions. Don't hold me to that, though :P
Good luck with your search for the understanding of Ruby blocks. Maybe Jason Seifer, or another Ruby pro, will stop by and go into more detail.