From: Gavin Sinclair Date: 2002-12-06T10:36:16+09:00 Subject: Re: Ruby Book for People Who Aren't (Yet) Programmers From: "Chris Pine" > ----- Original Message ----- > Why not use loop do ... end? I find it more natural than while(true) ... > ---------------------------- > > Yeah, I thought about that. I decided against it because I wanted to put > off 'do' for as long as possible. I remember getting confused when code > like this didn't work: > > if (foo < 5) do > puts 'foo is relatively small.' > end > > I understand now why it doesn't work, but until I really explain blocks, I > want to avoid using them. > > Chris That reasoning seems a bit far-fetched to me (even though it's based on your experience :). while true ... end is a progamming idiom. loop do ... end is quite a natural expression. The student needn't be told it's a block. As you do with objects, methods, etc., they can be introduced to blocks without knowing it. Gavin