From: ddet@... (Det) Date: 2002-09-10T17:53:36+09:00 Subject: Re: Larry Wall's comments on Ruby Reimer Behrends wrote in message news:... > Another one is > > statement while condition > > Noting that the condition is tested before the statement is executed > seems to be contrary to how every other language with test-at-end > loops does it. Hum. First of all I think the "Principle of Least Surprise" does never say _no_ surprise. For me it works this way: I read how one thing works. I read how another thing works and see the similarities, the 'common concept'. I assume that a third thing works the same way and it does. Aha, surely, no surprise. But then I'm surprised, a fourth thing works in another way. Oh, why? I read for the concepts behind this fourth thing and get an 'Aha!'-effect as it has a good reason to work different. Then I try a fifth thing out, and based on my former experience I can better estimate which of the two ways will be used. I assume the correct one, no surprise. And: I find this way working better in Ruby than in other languages. (BTW: This way is in general the same for programmers with experience in other languages changing to Ruby as for absolute novices. The problems are in another area). Regarding the above example: Learning (after the first surprise) that statement while condition is not part of the loop-concept of 'test-at-end' but part or the syntactic-sugar-concept of 'statement modifiers' you will automatically assume that statement if condition works the same. (Contrary, knowing the modifier concept you would be surprised when the while *would* work foot-controlled). > To discover then that > > begin statement end while condition > > works the other way round is even more confusing. Hum, ok ... ;-) . Bye Dirk Detering -aka Det