<?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 for matt burns</title>
	<atom:link href="http://www.mattburns.co.uk/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattburns.co.uk/blog</link>
	<description></description>
	<lastBuildDate>Tue, 17 Jan 2012 12:27:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>Comment on How to stop Google Chrome using your location when searching by Steve</title>
		<link>http://www.mattburns.co.uk/blog/2011/04/08/how-to-stop-google-chrome-using-your-location-when-searching/#comment-15201</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 17 Jan 2012 12:27:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattburns.co.uk/blog/?p=195#comment-15201</guid>
		<description>Stayed as .co.uk even after adding .com</description>
		<content:encoded><![CDATA[<p>Stayed as .co.uk even after adding .com</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to detect browser support for File Api and drag and drop with javascript by matt</title>
		<link>http://www.mattburns.co.uk/blog/2011/04/17/how-to-detect-browser-support-for-file-api-and-drag-and-drop-with-javascript/#comment-14952</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Tue, 03 Jan 2012 17:36:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattburns.co.uk/blog/?p=203#comment-14952</guid>
		<description>The point was to test for browser support of both the File API and Drag and Drop support. (see title)</description>
		<content:encoded><![CDATA[<p>The point was to test for browser support of both the File API and Drag and Drop support. (see title)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to dynamically choose the color of your Google maps marker pin using javascript by Dan Burhans</title>
		<link>http://www.mattburns.co.uk/blog/2011/10/07/how-to-dynamically-choose-the-color-of-you-google-maps-marker-pin-using-javascript/#comment-14945</link>
		<dc:creator>Dan Burhans</dc:creator>
		<pubDate>Tue, 03 Jan 2012 01:46:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattburns.co.uk/blog/?p=255#comment-14945</guid>
		<description>Matt, thank you for sharing this code.</description>
		<content:encoded><![CDATA[<p>Matt, thank you for sharing this code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to detect browser support for File Api and drag and drop with javascript by Stepan Suvorov</title>
		<link>http://www.mattburns.co.uk/blog/2011/04/17/how-to-detect-browser-support-for-file-api-and-drag-and-drop-with-javascript/#comment-14895</link>
		<dc:creator>Stepan Suvorov</dc:creator>
		<pubDate>Wed, 28 Dec 2011 12:55:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattburns.co.uk/blog/?p=203#comment-14895</guid>
		<description>Why do we need &quot;Modernizr.draganddrop&quot; here? Did not get it.</description>
		<content:encoded><![CDATA[<p>Why do we need &#8220;Modernizr.draganddrop&#8221; here? Did not get it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Fixing the volume up key on a nokia N95 by matt</title>
		<link>http://www.mattburns.co.uk/blog/2008/11/19/fixing-the-volume-up-key-on-a-nokia-n95/#comment-14742</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Sat, 10 Dec 2011 17:31:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattburns.co.uk/blog/?p=11#comment-14742</guid>
		<description>Glad to help Sandro!
I&#039;ve since broken my n95 beyond repair but it&#039;s still good to hear about people it&#039;s helping</description>
		<content:encoded><![CDATA[<p>Glad to help Sandro!<br />
I&#8217;ve since broken my n95 beyond repair but it&#8217;s still good to hear about people it&#8217;s helping</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Fixing the volume up key on a nokia N95 by Sandro</title>
		<link>http://www.mattburns.co.uk/blog/2008/11/19/fixing-the-volume-up-key-on-a-nokia-n95/#comment-14741</link>
		<dc:creator>Sandro</dc:creator>
		<pubDate>Sat, 10 Dec 2011 14:08:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattburns.co.uk/blog/?p=11#comment-14741</guid>
		<description>Thanks a lot for the tip, Matt!

A friend of mine gave me his old N95 8GB just a couple of days ago and I was kinda let down to find out that the volume rocker didn&#039;t work, since one of the things I was looking forward to the most was filling up the storage with music to listen during my commute. 

This did the trick, though! It took a few tries, but It&#039;s working perfectly, now! It&#039;s pretty awesome to see how many people you&#039;ve managed to help with this little fix!</description>
		<content:encoded><![CDATA[<p>Thanks a lot for the tip, Matt!</p>
<p>A friend of mine gave me his old N95 8GB just a couple of days ago and I was kinda let down to find out that the volume rocker didn&#8217;t work, since one of the things I was looking forward to the most was filling up the storage with music to listen during my commute. </p>
<p>This did the trick, though! It took a few tries, but It&#8217;s working perfectly, now! It&#8217;s pretty awesome to see how many people you&#8217;ve managed to help with this little fix!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simplify your API &#8211; Can Singletons be used for Good, not Evil? by matt</title>
		<link>http://www.mattburns.co.uk/blog/2011/11/14/simplify-your-api/#comment-14486</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Tue, 15 Nov 2011 10:08:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattburns.co.uk/blog/?p=304#comment-14486</guid>
		<description>I know I&#039;m on shaky ground but you haven&#039;t convinced me yet. Like you I also lived without singletons for years and didn&#039;t miss them. Since reading the Effective Java book I questioned why I thought singletons were bad and concluded I could use them again without feeling guilty.

Just to clear up the terminology a bit, you mention you use enums to &quot;store a bit of state&quot;. By which I assume you mean that they have attributes. It&#039;s important to note that a singleton that has a &quot;state&quot; in the sense that that state could change, would suck. No, let&#039;s make it clear, a singleton that is mutable would be pure evil. If Elvis had methods called &quot;startDancing()&quot; and &quot;stopDancing()&quot; or even any references to mutable objects then you can expect trouble ahead. A singleton that has references to a database is obviously a bad design.

&lt;a href=&quot;http://googletesting.blogspot.com/2008/08/root-cause-of-singletons.html&quot; rel=&quot;nofollow&quot;&gt;Here&#039;s a post&lt;/a&gt; from the Google testing blog that largely agrees with your point but does briefly mention that the real trouble with singletons comes when you allow mutability.

Elvis is allowed to have behaviour, methods that do stuff, just not methods that change Elvis&#039; state. For example, this would be ok:
&lt;pre lang=&quot;java&quot;&gt;
Elvis theKing = Elvis.INSTANCE;
SimilarityScore briansScore = theKing.rateImpersonator(brian);
&lt;/pre&gt;

A common argument against the use of singletons is that you do not declare your dependence on the singleton in your API. If an object requires an Elvis then the argument is that it should be declared in the constructor. Clients of your object then know that you need an Elvis to work. My argument is that sometimes, the use of the singleton in none of the API&#039;s beeswax, it&#039;s an implementation detail. You wouldn&#039;t expect an object to be constructed with pi.

I think the singleton is a good way to represent something that exists only once in the universe, and never changes. Like Elvis.</description>
		<content:encoded><![CDATA[<p>I know I&#8217;m on shaky ground but you haven&#8217;t convinced me yet. Like you I also lived without singletons for years and didn&#8217;t miss them. Since reading the Effective Java book I questioned why I thought singletons were bad and concluded I could use them again without feeling guilty.</p>
<p>Just to clear up the terminology a bit, you mention you use enums to &#8220;store a bit of state&#8221;. By which I assume you mean that they have attributes. It&#8217;s important to note that a singleton that has a &#8220;state&#8221; in the sense that that state could change, would suck. No, let&#8217;s make it clear, a singleton that is mutable would be pure evil. If Elvis had methods called &#8220;startDancing()&#8221; and &#8220;stopDancing()&#8221; or even any references to mutable objects then you can expect trouble ahead. A singleton that has references to a database is obviously a bad design.</p>
<p><a href="http://googletesting.blogspot.com/2008/08/root-cause-of-singletons.html" rel="nofollow">Here&#8217;s a post</a> from the Google testing blog that largely agrees with your point but does briefly mention that the real trouble with singletons comes when you allow mutability.</p>
<p>Elvis is allowed to have behaviour, methods that do stuff, just not methods that change Elvis&#8217; state. For example, this would be ok:</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple"><table class="java"><tbody><tr class="li1"><td class="ln"><pre class="de1">1
2
</pre></td><td class="de1"><pre class="de1">Elvis theKing <span class="sy0">=</span> Elvis.<span class="me1">INSTANCE</span><span class="sy0">;</span>
SimilarityScore briansScore <span class="sy0">=</span> theKing.<span class="me1">rateImpersonator</span><span class="br0">&#40;</span>brian<span class="br0">&#41;</span><span class="sy0">;</span></pre></td></tr></tbody></table></div>
<div class="bwp-syntax-source"><pre class="no-parse">Elvis theKing = Elvis.INSTANCE;
SimilarityScore briansScore = theKing.rateImpersonator(brian);</pre></div></div>

<p>A common argument against the use of singletons is that you do not declare your dependence on the singleton in your API. If an object requires an Elvis then the argument is that it should be declared in the constructor. Clients of your object then know that you need an Elvis to work. My argument is that sometimes, the use of the singleton in none of the API&#8217;s beeswax, it&#8217;s an implementation detail. You wouldn&#8217;t expect an object to be constructed with pi.</p>
<p>I think the singleton is a good way to represent something that exists only once in the universe, and never changes. Like Elvis.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simplify your API &#8211; Can Singletons be used for Good, not Evil? by tintenfisch</title>
		<link>http://www.mattburns.co.uk/blog/2011/11/14/simplify-your-api/#comment-14480</link>
		<dc:creator>tintenfisch</dc:creator>
		<pubDate>Mon, 14 Nov 2011 22:10:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattburns.co.uk/blog/?p=304#comment-14480</guid>
		<description>I&#039;m wary of saying one should *never* do X, as doing so often far better demonstrates your own limitations than any real problems with X. Nevertheless I have to say that I&#039;ve lived quite happily without singletons for several years now and I&#039;m afraid that neither this nor the last post have made me long for them again.

There&#039;s even a delicious irony in that, over the two articles, you&#039;ve tried to press gang an enum into service as a singleton, only to end up with a singleton that looks really rather like an enum! Your Elvis object is an excellent representation of the real thing: like the real Elvis it has some attributes that will never change and like the real Elvis it doesn&#039;t do a lot because the real Elvis is, well, dead. I regularly write enums that do much the same (that is to say, they just store a bit of state, not that they die). If this is a singleton then I don&#039;t have any problem with it. 

I do have a problems with what you might call behavioural singletons, however. Once you&#039;ve hooked up with a singleton that does things, you&#039;ll be doing things his way forever after. Want to unit-test the code that depends on that database singleton? Well you&#039;d better have a database handy then. Want to run those tests as part of an overnight build? Brace yourself for a lot of spurious test failures every time the database has a bilious attack. Want your code to get its data from somewhere other than that miserable, stinking database? Ha - forget it!

As you say, the moment you try to unit test a piece of code like this, you&#039;ll most likely realise that the singleton&#039;s giving you gyp and remove it. But this only leaves me wondering why you&#039;d use the bloody thing in the first place. Have we hit the limits of singletons with Elvis, or do you think there&#039;s life in the old goat yet?</description>
		<content:encoded><![CDATA[<p>I&#8217;m wary of saying one should *never* do X, as doing so often far better demonstrates your own limitations than any real problems with X. Nevertheless I have to say that I&#8217;ve lived quite happily without singletons for several years now and I&#8217;m afraid that neither this nor the last post have made me long for them again.</p>
<p>There&#8217;s even a delicious irony in that, over the two articles, you&#8217;ve tried to press gang an enum into service as a singleton, only to end up with a singleton that looks really rather like an enum! Your Elvis object is an excellent representation of the real thing: like the real Elvis it has some attributes that will never change and like the real Elvis it doesn&#8217;t do a lot because the real Elvis is, well, dead. I regularly write enums that do much the same (that is to say, they just store a bit of state, not that they die). If this is a singleton then I don&#8217;t have any problem with it. </p>
<p>I do have a problems with what you might call behavioural singletons, however. Once you&#8217;ve hooked up with a singleton that does things, you&#8217;ll be doing things his way forever after. Want to unit-test the code that depends on that database singleton? Well you&#8217;d better have a database handy then. Want to run those tests as part of an overnight build? Brace yourself for a lot of spurious test failures every time the database has a bilious attack. Want your code to get its data from somewhere other than that miserable, stinking database? Ha &#8211; forget it!</p>
<p>As you say, the moment you try to unit test a piece of code like this, you&#8217;ll most likely realise that the singleton&#8217;s giving you gyp and remove it. But this only leaves me wondering why you&#8217;d use the bloody thing in the first place. Have we hit the limits of singletons with Elvis, or do you think there&#8217;s life in the old goat yet?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to write Singletons in java by matt</title>
		<link>http://www.mattburns.co.uk/blog/2011/10/26/how-to-write-singletons-in-java/#comment-14477</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Mon, 14 Nov 2011 15:57:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattburns.co.uk/blog/?p=276#comment-14477</guid>
		<description>I wrote a new post to discuss my argument there... http://www.mattburns.co.uk/blog/2011/11/14/simplify-your-api/</description>
		<content:encoded><![CDATA[<p>I wrote a new post to discuss my argument there&#8230; <a href="http://www.mattburns.co.uk/blog/2011/11/14/simplify-your-api/" rel="nofollow">http://www.mattburns.co.uk/blog/2011/11/14/simplify-your-api/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to write Singletons in java by Simplify your API &#8211; Can Singletons be used for Good, not Evil? &#124; matt burns</title>
		<link>http://www.mattburns.co.uk/blog/2011/10/26/how-to-write-singletons-in-java/#comment-14476</link>
		<dc:creator>Simplify your API &#8211; Can Singletons be used for Good, not Evil? &#124; matt burns</dc:creator>
		<pubDate>Mon, 14 Nov 2011 15:55:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattburns.co.uk/blog/?p=276#comment-14476</guid>
		<description>[...] see the &quot;static&quot; keyword. When you type &quot;static&quot; a little ...I recently wrote an article about singletons in java. The only thing I wanted to cover was that if you really want a singleton, I recommend you [...]</description>
		<content:encoded><![CDATA[<p>[...] see the &quot;static&quot; keyword. When you type &quot;static&quot; a little &#8230;I recently wrote an article about singletons in java. The only thing I wanted to cover was that if you really want a singleton, I recommend you [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

