<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Peter Williams &#187; JavaScript</title>
	<atom:link href="http://barelyenough.org/blog/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://barelyenough.org</link>
	<description>… and there is much to be learned</description>
	<lastBuildDate>Mon, 23 Jan 2012 18:32:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Javascript</title>
		<link>http://barelyenough.org/blog/2011/01/javascript-feelings/</link>
		<comments>http://barelyenough.org/blog/2011/01/javascript-feelings/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 17:21:59 +0000</pubDate>
		<dc:creator>Peter Williams</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://barelyenough.org/?p=549</guid>
		<description><![CDATA[From the coffeescript homepage: Underneath all of those embarrassing braces and semicolons, JavaScript has always had a gorgeous object model at its heart. That sums up my feelings about javascript almost exactly.]]></description>
			<content:encoded><![CDATA[<p>From the <a href="http://jashkenas.github.com/coffee-script/">coffeescript</a> homepage:</p>
<blockquote><p>Underneath all of those embarrassing braces and semicolons, JavaScript has always had a gorgeous object model at its heart.</p></blockquote>
<p>That sums up my feelings about javascript almost exactly.</p>
]]></content:encoded>
			<wfw:commentRss>http://barelyenough.org/blog/2011/01/javascript-feelings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Is Sweet</title>
		<link>http://barelyenough.org/blog/2006/04/javascript-is-sweet/</link>
		<comments>http://barelyenough.org/blog/2006/04/javascript-is-sweet/#comments</comments>
		<pubDate>Tue, 18 Apr 2006 04:36:01 +0000</pubDate>
		<dc:creator>Peter Williams</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://pezra.barelyenough.org/blog/?p=227</guid>
		<description><![CDATA[While reading Oliver Steele&#8217;s article on JavaScript Memoization this bit jumped out at me. function Angle(radians) {this.setRadians(radians)} Angle.prototype.setRadians = function(radians) { this.radians = radians; this.getDegrees.reset(); }; Angle.prototype.getDegrees = function() { return this.radians * 180 / Math.PI; } memoizeConstantMethod(Angle.prototype, 'getDegrees'); The reason that jumped out is that getDegrees is a function that returns a number, but [...]]]></description>
			<content:encoded><![CDATA[<p>While reading <a href='http://osteele.com/archives/2006/04/javascript-memoization'>Oliver Steele&#8217;s article on JavaScript Memoization</a> this bit jumped out at me.</p>
<blockquote cite='http://osteele.com/archives/2006/04/javascript-memoization'>
<pre>
<code>
function Angle(radians) {this.setRadians(radians)}
Angle.prototype.setRadians = function(radians) {
  this.radians = radians;
  this.getDegrees.reset();
};
Angle.prototype.getDegrees = function() {
  return this.radians * 180 / Math.PI;
}
memoizeConstantMethod(Angle.prototype, 'getDegrees');
</code>
</pre>
</blockquote>
<p>The reason that jumped out is that <code>getDegrees</code> is a function that returns a number, but in the above code you see this <code>this.getDegrees.reset()</code>. In other languages that would require a <code>reset</code> method on number objects, but not in JavaScript. In JavaScript methods are objects and, therefore, can have methods of their own<sup id='54fa3b6e99cb9470f7788b4006d3dc57b5d1e8e9fnref:1'><a href='#54fa3b6e99cb9470f7788b4006d3dc57b5d1e8e9fn:1' rel='footnote'>1</a></sup>. This allows you to get the effect of <a href='http://nat.truemesh.com/archives/000535.html'>high-order messaging</a> without all the fuss.</p>
<div class='footnotes'>
<hr />
<ol>
<li id='54fa3b6e99cb9470f7788b4006d3dc57b5d1e8e9fn:1'>
<p>Is that the exact semantics that allows this functionality in JavaScript?</p>
<p><a href='#54fa3b6e99cb9470f7788b4006d3dc57b5d1e8e9fnref:1' rev='footnote'>&#8617;</a></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://barelyenough.org/blog/2006/04/javascript-is-sweet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

