<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: JavaScript Method Overloading</title>
	<atom:link href="http://ajaxian.com/archives/javascript-method-overloading/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/javascript-method-overloading</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: jdempcy</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-263086</link>
		<dc:creator>jdempcy</dc:creator>
		<pubDate>Wed, 23 Apr 2008 19:07:40 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-263086</guid>
		<description>Another version with type-checking:

http://www.thetruetribe.com/2008/03/javascript-method-overloading.html</description>
		<content:encoded><![CDATA[<p>Another version with type-checking:</p>
<p><a href="http://www.thetruetribe.com/2008/03/javascript-method-overloading.html" rel="nofollow">http://www.thetruetribe.com/2008/03/javascript-method-overloading.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Thuerigen</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258988</link>
		<dc:creator>Frank Thuerigen</dc:creator>
		<pubDate>Sun, 18 Nov 2007 14:12:35 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258988</guid>
		<description>Here is the type checking part of it, for those who like this approach:
http://blog.phpbuero.de/?p=17
Have fun John, and keep up the good work!</description>
		<content:encoded><![CDATA[<p>Here is the type checking part of it, for those who like this approach:<br />
<a href="http://blog.phpbuero.de/?p=17" rel="nofollow">http://blog.phpbuero.de/?p=17</a><br />
Have fun John, and keep up the good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258758</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 15 Nov 2007 12:23:44 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258758</guid>
		<description>Whilst not &quot;best practise&quot; in most common day situations, this kind of information expands knowledge over JavaScript for solving potential future dilema&#039;s. Innability to see useful implementations for nifty snippets, does not render the information useless. ;)
.
Keep em commin!</description>
		<content:encoded><![CDATA[<p>Whilst not &#8220;best practise&#8221; in most common day situations, this kind of information expands knowledge over JavaScript for solving potential future dilema&#8217;s. Innability to see useful implementations for nifty snippets, does not render the information useless. ;)<br />
.<br />
Keep em commin!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Bunting</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258736</link>
		<dc:creator>Jason Bunting</dc:creator>
		<pubDate>Thu, 15 Nov 2007 05:02:34 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258736</guid>
		<description>David - why would you use this over the anonymous object syntax alluded to by Jason (not me) in the second comment, other than to impress people with the fact that it simulates multimethods?

As for those that suggest checking the types, etc. of the arguments being passed in to determine what to do: what kind of mess would that be? You would end up with all sorts of code trying to figure out what to do when really you should be focusing on the task at hand - the anonymous object syntax seems to me the best fit all-around.

But what do I know? Just another opinionated developer... :P</description>
		<content:encoded><![CDATA[<p>David &#8211; why would you use this over the anonymous object syntax alluded to by Jason (not me) in the second comment, other than to impress people with the fact that it simulates multimethods?</p>
<p>As for those that suggest checking the types, etc. of the arguments being passed in to determine what to do: what kind of mess would that be? You would end up with all sorts of code trying to figure out what to do when really you should be focusing on the task at hand &#8211; the anonymous object syntax seems to me the best fit all-around.</p>
<p>But what do I know? Just another opinionated developer&#8230; :P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yoink</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258734</link>
		<dc:creator>yoink</dc:creator>
		<pubDate>Thu, 15 Nov 2007 02:05:20 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258734</guid>
		<description>I&#039;ve used this approach in both Java &amp; Python, and whilst it is handy, it doesn&#039;t *really* solve any problems that couldn&#039;t have been handled in some other usually more elegant way. It also makes it hard to troubleshoot larger scripts, if it isn&#039;t used correctly, in the right situations.
However, it is one of those &quot;nice to have&quot; features :o)</description>
		<content:encoded><![CDATA[<p>I&#8217;ve used this approach in both Java &amp; Python, and whilst it is handy, it doesn&#8217;t *really* solve any problems that couldn&#8217;t have been handled in some other usually more elegant way. It also makes it hard to troubleshoot larger scripts, if it isn&#8217;t used correctly, in the right situations.<br />
However, it is one of those &#8220;nice to have&#8221; features :o)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258732</link>
		<dc:creator>David</dc:creator>
		<pubDate>Thu, 15 Nov 2007 01:18:03 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258732</guid>
		<description>To those saying &quot;it isn&#039;t necessary just do ...&quot;, you miss both the source of this feature and it&#039;s true benefits.

John is trying to approximate Multimethods, which is a feature of languages which have &lt;a href=&quot;http://en.wikipedia.org/wiki/Multiple_dispatch&quot; rel=&quot;nofollow&quot;&gt;Multiple Dispatch&lt;/a&gt; on methods.

What John is doing manually is ideally done automatically by the language based on the method signature (given multiple definitions of the same function with differing signatures).

Multiple dispatch is more commonly done on the &lt;b&gt;type&lt;/b&gt; and &lt;b&gt;arity&lt;/b&gt; of the arguments rather than their values.

JS2/ES4 looks to be gaining native multimethods (similar in specificiation to those of Perl 6).</description>
		<content:encoded><![CDATA[<p>To those saying &#8220;it isn&#8217;t necessary just do &#8230;&#8221;, you miss both the source of this feature and it&#8217;s true benefits.</p>
<p>John is trying to approximate Multimethods, which is a feature of languages which have <a href="http://en.wikipedia.org/wiki/Multiple_dispatch" rel="nofollow">Multiple Dispatch</a> on methods.</p>
<p>What John is doing manually is ideally done automatically by the language based on the method signature (given multiple definitions of the same function with differing signatures).</p>
<p>Multiple dispatch is more commonly done on the <b>type</b> and <b>arity</b> of the arguments rather than their values.</p>
<p>JS2/ES4 looks to be gaining native multimethods (similar in specificiation to those of Perl 6).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gonchuki</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258726</link>
		<dc:creator>gonchuki</dc:creator>
		<pubDate>Wed, 14 Nov 2007 23:37:25 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258726</guid>
		<description>even when I prefer using a plain object or the Mootools way, it&#039;s a pretty neat hack that shows once again the limitless power of javascript.
thumbs up for John and his crazy ideas.</description>
		<content:encoded><![CDATA[<p>even when I prefer using a plain object or the Mootools way, it&#8217;s a pretty neat hack that shows once again the limitless power of javascript.<br />
thumbs up for John and his crazy ideas.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Hartmann</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258722</link>
		<dc:creator>Jon Hartmann</dc:creator>
		<pubDate>Wed, 14 Nov 2007 22:03:16 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258722</guid>
		<description>Yeah, I have to third the opinion that this isn&#039;t necessary. Test the arguments passed in or simply take in an argument object with the various  things you need. Its a nice proof of concept, but its not a very JavaScript-y solution.</description>
		<content:encoded><![CDATA[<p>Yeah, I have to third the opinion that this isn&#8217;t necessary. Test the arguments passed in or simply take in an argument object with the various  things you need. Its a nice proof of concept, but its not a very JavaScript-y solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiago Albineli Motta</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258721</link>
		<dc:creator>Tiago Albineli Motta</dc:creator>
		<pubDate>Wed, 14 Nov 2007 21:56:44 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258721</guid>
		<description>I would be good if the type of arguments could be tested too. But, i think it&#039;s a unecessary complexity.</description>
		<content:encoded><![CDATA[<p>I would be good if the type of arguments could be tested too. But, i think it&#8217;s a unecessary complexity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jake</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258720</link>
		<dc:creator>jake</dc:creator>
		<pubDate>Wed, 14 Nov 2007 21:30:25 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258720</guid>
		<description>Resig must dream in JavaScript.</description>
		<content:encoded><![CDATA[<p>Resig must dream in JavaScript.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258718</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Wed, 14 Nov 2007 20:37:53 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258718</guid>
		<description>I agree with Jason. This isn&#039;t necessary. Just test the arguments passed in.</description>
		<content:encoded><![CDATA[<p>I agree with Jason. This isn&#8217;t necessary. Just test the arguments passed in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harald</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258714</link>
		<dc:creator>Harald</dc:creator>
		<pubDate>Wed, 14 Nov 2007 19:54:26 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258714</guid>
		<description>MooTools has a different approach in 1.2 for various methods. You can pass various argument types. They are not linked by arguments-length but by type, really neat.
Anyway, I think giving an array/object with optional arguments is still the most readable and most consistent way.</description>
		<content:encoded><![CDATA[<p>MooTools has a different approach in 1.2 for various methods. You can pass various argument types. They are not linked by arguments-length but by type, really neat.<br />
Anyway, I think giving an array/object with optional arguments is still the most readable and most consistent way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258704</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 14 Nov 2007 17:28:45 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258704</guid>
		<description>Why is this necessary?  You can simply make a function called &quot;find&quot; and access the arguments array from within.  Then do some switch  logic internally on either the number of arguments, or by type and then do your stuff.  Also, it is often much more convenient to have a method take an &quot;anonymous object&quot; and pass parameters by name such as this...

find({first:&quot;Jim&quot;,last:&quot;bob&quot;}); or find({name:&quot;Jim Bob&quot;}) 

Named parameters is something I really miss in C# development! I think Javascript is incredibly flexible, doesn&#039;t require &quot;hacks&quot;, but isn&#039;t your traditional OO language either.  Both have strengths and weaknesses but most of the time I find overloading in Javascript more flexible, yet terse than C# or Java.</description>
		<content:encoded><![CDATA[<p>Why is this necessary?  You can simply make a function called &#8220;find&#8221; and access the arguments array from within.  Then do some switch  logic internally on either the number of arguments, or by type and then do your stuff.  Also, it is often much more convenient to have a method take an &#8220;anonymous object&#8221; and pass parameters by name such as this&#8230;</p>
<p>find({first:&#8221;Jim&#8221;,last:&#8221;bob&#8221;}); or find({name:&#8221;Jim Bob&#8221;}) </p>
<p>Named parameters is something I really miss in C# development! I think Javascript is incredibly flexible, doesn&#8217;t require &#8220;hacks&#8221;, but isn&#8217;t your traditional OO language either.  Both have strengths and weaknesses but most of the time I find overloading in Javascript more flexible, yet terse than C# or Java.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vance Dubberly</title>
		<link>http://ajaxian.com/archives/javascript-method-overloading/comment-page-1#comment-258702</link>
		<dc:creator>vance Dubberly</dc:creator>
		<pubDate>Wed, 14 Nov 2007 17:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/javascript-method-overloading#comment-258702</guid>
		<description>This is a pretty cool hack.  Its kinda sucks that there has to be so many cool hacks to make Javascript a pretty cool language.</description>
		<content:encoded><![CDATA[<p>This is a pretty cool hack.  Its kinda sucks that there has to be so many cool hacks to make Javascript a pretty cool language.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

