<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Method Names</title>
	<link>http://www.mcdonaldland.info/2008/04/07/method-names/</link>
	<description>A magical discussion of software, economics, and other assorted theories. but mainly software.</description>
	<pubDate>Thu, 07 Aug 2008 23:00:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Steven B.</title>
		<link>http://www.mcdonaldland.info/2008/04/07/method-names/#comment-295</link>
		<dc:creator>Steven B.</dc:creator>
		<pubDate>Tue, 08 Apr 2008 12:26:42 +0000</pubDate>
		<guid>http://www.mcdonaldland.info/2008/04/07/method-names/#comment-295</guid>
		<description>If the variable itself is used more than the method the first is better. That way you could say &lt;i&gt;supressMultiLanguage&lt;/i&gt; inline and have it read like plain english. If you were calling the method more then the second one would be better because it reads more like plain english.

Its all about where you call things from the most.</description>
		<content:encoded><![CDATA[<p>If the variable itself is used more than the method the first is better. That way you could say <i>supressMultiLanguage</i> inline and have it read like plain english. If you were calling the method more then the second one would be better because it reads more like plain english.</p>
<p>Its all about where you call things from the most.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason McDonald</title>
		<link>http://www.mcdonaldland.info/2008/04/07/method-names/#comment-294</link>
		<dc:creator>Jason McDonald</dc:creator>
		<pubDate>Tue, 08 Apr 2008 12:24:37 +0000</pubDate>
		<guid>http://www.mcdonaldland.info/2008/04/07/method-names/#comment-294</guid>
		<description>Last comment then I'm going to let the common consensus take over. 

"2. True doesn’t mean true. A “true” value means “off” or false. Better to make true mean true."

This rings true (no pun intended) for both representations... 

isSupressMultiLanguage() - true means its disabled, which is the primary state we care about.

isMultiLanguageSupressed() - true also means it is disabled. 

Your argument for the mental bit switching is a valid one, just not in this particular case, primarily due to the need surrounding the variable/method. It should be noted that the best name for a method isn't a cut or dry thing,  hence my entire argument in the original post, and that it is extremely context sensitive. In this above case the "mental bit switching" is negated by the fact that we simply want to know if the multi-language feature is off. If we were wanting to know if it was on, this method name would be counter-intuitive. And we would likely want something that wouldn't require the "mental bit switching".</description>
		<content:encoded><![CDATA[<p>Last comment then I&#8217;m going to let the common consensus take over. </p>
<p>&#8220;2. True doesn’t mean true. A “true” value means “off” or false. Better to make true mean true.&#8221;</p>
<p>This rings true (no pun intended) for both representations&#8230; </p>
<p>isSupressMultiLanguage() - true means its disabled, which is the primary state we care about.</p>
<p>isMultiLanguageSupressed() - true also means it is disabled. </p>
<p>Your argument for the mental bit switching is a valid one, just not in this particular case, primarily due to the need surrounding the variable/method. It should be noted that the best name for a method isn&#8217;t a cut or dry thing,  hence my entire argument in the original post, and that it is extremely context sensitive. In this above case the &#8220;mental bit switching&#8221; is negated by the fact that we simply want to know if the multi-language feature is off. If we were wanting to know if it was on, this method name would be counter-intuitive. And we would likely want something that wouldn&#8217;t require the &#8220;mental bit switching&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Turansky</title>
		<link>http://www.mcdonaldland.info/2008/04/07/method-names/#comment-293</link>
		<dc:creator>Mark Turansky</dc:creator>
		<pubDate>Tue, 08 Apr 2008 05:14:37 +0000</pubDate>
		<guid>http://www.mcdonaldland.info/2008/04/07/method-names/#comment-293</guid>
		<description>Fowler has a Refactoring Pattern called "Rename Method" to make code easier to read.  He thinks it's pretty important.  I agree with him.  I'm sure you and most others do, too.

So what's the problem with "isSuppressMultiLingual"?  It's not the end of the world, but it's not as simple as it could be. 

1.  isSuppressMultiLingual isn't English.  It takes an extra cycle or two to parse. 

2.  True doesn't mean true.  A "true" value means "off" or false.  Better to make true mean true.

Taken together, you have to first parse broken English and then flip the bit in your head to understand if it's on or off.

Compare that with:

isMultiLanguageEnabled( )

Active voice, plain English, and true means true.

If this were the only instance of code like this in a codebase, no big deal.  Life goes on.  The code still works.  But when little things like this are repeated hundreds and thousands of times in a large project written by a lot of junior people ...  well, you've seen the result of that.

To prevent a big nasty mess, everyone on a team has to be pay attention to little details like this.</description>
		<content:encoded><![CDATA[<p>Fowler has a Refactoring Pattern called &#8220;Rename Method&#8221; to make code easier to read.  He thinks it&#8217;s pretty important.  I agree with him.  I&#8217;m sure you and most others do, too.</p>
<p>So what&#8217;s the problem with &#8220;isSuppressMultiLingual&#8221;?  It&#8217;s not the end of the world, but it&#8217;s not as simple as it could be. </p>
<p>1.  isSuppressMultiLingual isn&#8217;t English.  It takes an extra cycle or two to parse. </p>
<p>2.  True doesn&#8217;t mean true.  A &#8220;true&#8221; value means &#8220;off&#8221; or false.  Better to make true mean true.</p>
<p>Taken together, you have to first parse broken English and then flip the bit in your head to understand if it&#8217;s on or off.</p>
<p>Compare that with:</p>
<p>isMultiLanguageEnabled( )</p>
<p>Active voice, plain English, and true means true.</p>
<p>If this were the only instance of code like this in a codebase, no big deal.  Life goes on.  The code still works.  But when little things like this are repeated hundreds and thousands of times in a large project written by a lot of junior people &#8230;  well, you&#8217;ve seen the result of that.</p>
<p>To prevent a big nasty mess, everyone on a team has to be pay attention to little details like this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason McDonald</title>
		<link>http://www.mcdonaldland.info/2008/04/07/method-names/#comment-292</link>
		<dc:creator>Jason McDonald</dc:creator>
		<pubDate>Mon, 07 Apr 2008 18:23:53 +0000</pubDate>
		<guid>http://www.mcdonaldland.info/2008/04/07/method-names/#comment-292</guid>
		<description>I don't really see how one could interpret the first method any way other than that it represents a boolean value (in java at least, which is the language in question for this post). 

If we were checking to see if the Suppress object was multi-language it would be:

suppress.isMultiLanguage()

not

[some object].isSupressMultiLanguage()

I'm not arguing for one being more virtuous than the other - clearly the second way is closer to English and thus easier to read (for native English speakers) - I am simply making the argument that both are perfectly understandable and thus legitimate options.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t really see how one could interpret the first method any way other than that it represents a boolean value (in java at least, which is the language in question for this post). </p>
<p>If we were checking to see if the Suppress object was multi-language it would be:</p>
<p>suppress.isMultiLanguage()</p>
<p>not</p>
<p>[some object].isSupressMultiLanguage()</p>
<p>I&#8217;m not arguing for one being more virtuous than the other - clearly the second way is closer to English and thus easier to read (for native English speakers) - I am simply making the argument that both are perfectly understandable and thus legitimate options.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mwlinnem</title>
		<link>http://www.mcdonaldland.info/2008/04/07/method-names/#comment-291</link>
		<dc:creator>mwlinnem</dc:creator>
		<pubDate>Mon, 07 Apr 2008 18:15:52 +0000</pubDate>
		<guid>http://www.mcdonaldland.info/2008/04/07/method-names/#comment-291</guid>
		<description>I greatly prefer the second, actually. Mostly because It is grammatically correct in English. For the first example, in normal prose we would either have to switch to active voice (as oppose to passive voice)  making it "areWeSuppressingMultiLanguage", or even worse, add a sort of caveat, as in "is it suppressed? (multi-language)."

To understand the first example, native English speakers have to perform mental transformation on the words. They may get it right the first time, or they may interpret it incorrectly a couple times before they get it right (decreasing readability), or, worst of all, they may decide on a the meaning incorrectly. For instance, in this case, one might decide that there was an object "suppress", and we are checking to see whether or not it is multi-language.</description>
		<content:encoded><![CDATA[<p>I greatly prefer the second, actually. Mostly because It is grammatically correct in English. For the first example, in normal prose we would either have to switch to active voice (as oppose to passive voice)  making it &#8220;areWeSuppressingMultiLanguage&#8221;, or even worse, add a sort of caveat, as in &#8220;is it suppressed? (multi-language).&#8221;</p>
<p>To understand the first example, native English speakers have to perform mental transformation on the words. They may get it right the first time, or they may interpret it incorrectly a couple times before they get it right (decreasing readability), or, worst of all, they may decide on a the meaning incorrectly. For instance, in this case, one might decide that there was an object &#8220;suppress&#8221;, and we are checking to see whether or not it is multi-language.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.201 seconds -->
