From: dblack@... Date: 2006-07-25T22:35:15+09:00 Subject: Re: I'll have the duck! Hi -- On Tue, 25 Jul 2006, Daniel DeLorme wrote: > dblack@wobblini.net wrote: >> I've always thought that Dave Thomas coined it, and that it then >> caught on (including outside of Ruby). Either way -- I think that >> using "duck" in method and class names dilutes the meaning of "duck >> typing", and also does a disservice to the stuff people are writing, >> some of which may be quite interesting. When I see these >> prototype-style libraries named "duck" this and that, I'm just aware > > So your objection is merely semantic? If DuckTyping isn't the "proper" > word to use, what would you suggest? That little module I knocked > together was just a way to mix-in methods into any object that responds > to the proper quacks--er, messages. DuckTyping seems like a good way to > describe that to me. The problem is that "duck typing" is already "taken" :-) >> of the fact that duck typing isn't something one can implement in >> code, and that therefore the point of this code is being obscured >> rather than revealed by the naming. > > That sounds very silly, like saying that OOP or functional programming > can't be implemented in code. I do wish we could keep "silly" and "delusional" and so on out of it. Anyway -- my point is that duck typing is not a library-level language facility that you or I can write and 'require' and thus add to Ruby. Even if there's a module called DuckTyping, people who ignore that module are still 100% as capable of using a duck-typing approach as people who use the module. The existence of the module is orthogonal to both the duck-typing friendliness of the language, and the duck-typing programming style of the people using the language. It's a bit like writing a module called ObjectOrientation. The module might do something wonderful, but it doesn't add object orientation to Ruby :-) (I think I stole that example from Chad Fowler, from a discussion of something else a couple of years ago.) So my suggestion was, and is, to name your module something else, and then trust duck-typing devotees (and others) to examine it and decide whether it helps them out. David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy http://www.manning.com/black => RUBY FOR RAILS (reviewed on Slashdot, 7/12/2006!) http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log dblack@wobblini.net => me