<?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: Recent Readings of Interest</title>
	<atom:link href="http://agilepainrelief.com/notesfromatooluser/2008/11/recent-readings-of-interest.html/feed" rel="self" type="application/rss+xml" />
	<link>http://agilepainrelief.com/notesfromatooluser/2008/11/recent-readings-of-interest.html</link>
	<description>Best practices for your goals</description>
	<lastBuildDate>Thu, 11 Mar 2010 23:31:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Misko Hevery</title>
		<link>http://agilepainrelief.com/notesfromatooluser/2008/11/recent-readings-of-interest.html/comment-page-1#comment-138</link>
		<dc:creator>Misko Hevery</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://agilepainrelief.com/2008/11/recent-readings-of-interest/#comment-138</guid>
		<description>To clarify, I said, in my code I don&#039;t create statics. I have no choice but to call Math.abs(). And I am not going to wrap it in another class just to stick to my guns.

Math.abs() is not a problem since it is a leaf of a call graph. Static methods become a problem when they move closer to the main method. With main method being the worst.

Suppose you have User.get() where inside of it you talk to the the database to fetch the user. The issue here is that you can&#039;t prevent User.get() from executing. Sprinkling your code with Math.abs() is benign. But User.get() will make it impossible to test.

The other problem is that suppose you have a benign method such as ID.parse() which converts a string to some typesafe id. What if you change the strategy and put some calls to the DB inside to ID.parse()? You just went from benign to problem. The point is that static method is a slippery slope. And it is very easy for it to be a problem.

So I have a simple policy. No static methods in the code I write. :-)
</description>
		<content:encoded><![CDATA[<p>To clarify, I said, in my code I don&#8217;t create statics. I have no choice but to call Math.abs(). And I am not going to wrap it in another class just to stick to my guns.</p>
<p>Math.abs() is not a problem since it is a leaf of a call graph. Static methods become a problem when they move closer to the main method. With main method being the worst.</p>
<p>Suppose you have User.get() where inside of it you talk to the the database to fetch the user. The issue here is that you can&#8217;t prevent User.get() from executing. Sprinkling your code with Math.abs() is benign. But User.get() will make it impossible to test.</p>
<p>The other problem is that suppose you have a benign method such as ID.parse() which converts a string to some typesafe id. What if you change the strategy and put some calls to the DB inside to ID.parse()? You just went from benign to problem. The point is that static method is a slippery slope. And it is very easy for it to be a problem.</p>
<p>So I have a simple policy. No static methods in the code I write. <img src='http://agilepainrelief.com/site/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
