<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-8840979806248747743.post7038557151252885698..comments</id><updated>2008-03-05T06:12:34.607-08:00</updated><category term='ruby'/><category term='feeds'/><category term='Windows XP'/><category term='Vista'/><category term='education'/><category term='NWEN'/><category term='Microsoft'/><category term='product support'/><category term='debugging'/><category term='gadgets'/><category term='Amazon'/><category term='web applications'/><category term='competition'/><category term='privacy'/><category term='source code control'/><category term='open source'/><category term='algorithms'/><category term='public speaking'/><category term='Azure'/><category term='fundraising'/><category term='dogfood'/><category term='outsourcing'/><category term='memcache'/><category term='beachware'/><category term='prototyping'/><category term='python'/><category term='performance'/><category term='self hosting'/><category term='learning'/><category term='pipes'/><category term='app engine'/><category term='EC2'/><category term='blogs'/><category term='hardware'/><category term='startups'/><category term='presentations'/><category term='work/life balance'/><category term='StartPad'/><category term='business plans'/><category term='jQuery'/><category term='cloud computing'/><category term='schedules'/><category term='security'/><category term='politics'/><category term='typing'/><category term='best practices'/><category term='entrepreneurship'/><category term='backups'/><category term='puzzazz'/><category term='networking'/><category term='shipping'/><category term='30 day startup'/><category term='C#'/><category term='passion'/><category term='Microsoft Windows'/><category term='petitions'/><category term='consistency'/><category term='priorities'/><category term='software projects'/><category term='Django'/><category term='languages'/><category term='quality'/><category term='project management'/><category term='investors'/><category term='google'/><title type='text'>Comments on thisDev: Quacking Again - More On Duck Typing</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.thisdev.com/feeds/7038557151252885698/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8840979806248747743/7038557151252885698/comments/default'/><link rel='alternate' type='text/html' href='http://www.thisdev.com/2008/03/quacking-again-more-on-duck-typing.html'/><author><name>Roy Leban</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8840979806248747743.post-8177860858116888067</id><published>2008-03-05T06:12:00.000-08:00</published><updated>2008-03-05T06:12:00.000-08:00</updated><title type='text'>I agree with Roy's basic point, but I think the ex...</title><content type='html'>I agree with Roy's basic point, but I think the example is poorly chosen. Whether to render an object as HTML or a JSON object is not a choice the object should be making, it's a choice that the high-level code should be making based on the context in which the object is being serialized.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8840979806248747743/7038557151252885698/comments/default/8177860858116888067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8840979806248747743/7038557151252885698/comments/default/8177860858116888067'/><link rel='alternate' type='text/html' href='http://www.thisdev.com/2008/03/quacking-again-more-on-duck-typing.html?showComment=1204726320000#c8177860858116888067' title=''/><author><name>Rhu/nmHz</name><uri>http://www.blogger.com/profile/02999256144096980826</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.thisdev.com/2008/03/quacking-again-more-on-duck-typing.html' ref='tag:blogger.com,1999:blog-8840979806248747743.post-7038557151252885698' source='http://www.blogger.com/feeds/8840979806248747743/posts/default/7038557151252885698' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-782754555'/></entry><entry><id>tag:blogger.com,1999:blog-8840979806248747743.post-1775264856687358248</id><published>2008-03-03T03:12:00.000-08:00</published><updated>2008-03-03T03:12:00.000-08:00</updated><title type='text'>I was one of the people that thought that your arg...</title><content type='html'>I was one of the people that thought that your argument was a straw man and I think that this is pretty much just a repetition of it, let me make this clearer.&lt;BR/&gt;&lt;BR/&gt;Interfaces allow you to control the environment that a function can be called in: You can specify which type something has. That is based on the idea that you have a set of classes already defined that model your whole area of interest.&lt;BR/&gt;&lt;BR/&gt;In dynamic languages you (well "I") don't think like that: You know that you will not have "controlled environments" so (because "it's easier to ask for forgiveness than for permission") you just do what you want to do and handle the errors. That's not lazy, that's the way those languages work and that's the idiomatic way to use them.&lt;BR/&gt;&lt;BR/&gt;You can use constructs like "assert" (Ruby probably has something similar) to control the environment but that would bloat the code and make it harder to understand so it should be avoided.&lt;BR/&gt;&lt;BR/&gt;Raise/Throw meaningful exceptions that tell you what is wrong. When writing a function write in the docstring/comment for it, what "things" it can handle, use tests to make sure it all works together.&lt;BR/&gt;&lt;BR/&gt;So I do agree somewhat: You want some documentation about what some function expects, but putting it in the code with interfaces (or the workarounds you already presented) is very unidiomatic for dynamic languages and should be avoided.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8840979806248747743/7038557151252885698/comments/default/1775264856687358248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8840979806248747743/7038557151252885698/comments/default/1775264856687358248'/><link rel='alternate' type='text/html' href='http://www.thisdev.com/2008/03/quacking-again-more-on-duck-typing.html?showComment=1204542720000#c1775264856687358248' title=''/><author><name>tante</name><uri>http://www.blogger.com/profile/13712377319723399136</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://www.the-gay-bar.com/images/PirateMonkey.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.thisdev.com/2008/03/quacking-again-more-on-duck-typing.html' ref='tag:blogger.com,1999:blog-8840979806248747743.post-7038557151252885698' source='http://www.blogger.com/feeds/8840979806248747743/posts/default/7038557151252885698' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-782692888'/></entry></feed>
