On Thursday 29 December 2005 10:16 am, dblack / wobblini.net wrote: > Hi -- > > On Thu, 29 Dec 2005, Steve Litt wrote: > > On Thursday 29 December 2005 03:03 am, Surgeon wrote: > >> Oh, so many replies to my poor question! What a wonderful community! > > > > I think it's because A LOT of us were wondering the same thing. In > > general, RUBY conforms beautifully to Eric Raymond's "Rule of Least > > Surprise". IMHO > > s/RUBY/Ruby/ :-) In Ruby, P[olicy]OLS refers to what does or does not > surprise Matz. > > > symbols are an exception. > > A little surprise is OK. As Yohanes says, it's part of the learning > curve -- and Ruby does have a learning curve, even though it's > relatively gentle. The language has to be "allowed" to do things in a > way that are not identical to what programmers of other languages > expect. Otherwise its existence would serve no purpose. > > Just out of curiosity: can you describe how symbols would work if > they weren't surprising? They wouldn't exist, or they wouldn't be called symbols. If I'm referring to an instance instead of a value, I could call it &variable as in C, or I could call it :variable, but in that case I'd call it a reference, not a symbol. Personally, I think of the referencing and dereferencing in C as being unsurprising. C has plenty of surprises, but referencing and dereferencing is not one. From what I understand, symbols are used for things other than naming objects/variables. In such cases, it would be less surprising if they had a different syntax than the ones that name objects. A little surprise is OK. The subtle differnces of do/end and {/} in blocks is a little surprise. But in my opinion, symbols and their uses is a blizzard on the equator type surprise. The fact that symbols cause so much more confusion than most other Ruby facilities is an indicator. AFAIK there has been no good documentation on symbols. When I mean good, I mean like the thoughts that have gone into this thread -- thoughts valuable to the person who doesn't yet know symbols by instinct, at which time the documentation is moot anyway. SteveT Steve Litt http://www.troubleshooters.com slitt / troubleshooters.com