<?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: Is That How You Talk To People?</title> <atom:link href="http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/feed/" rel="self" type="application/rss+xml" /><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/</link> <description>inquisitive: adjective. given to inquiry, research, or asking questions; eager for knowledge; intellectually curious</description> <lastBuildDate>Tue, 22 May 2012 17:40:00 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Filip Duyck</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-50160</link> <dc:creator>Filip Duyck</dc:creator> <pubDate>Fri, 30 Jul 2010 10:00:50 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-50160</guid> <description>Why not have 2 properties (IsPanelWindowVisible and IsBusy) which you can set to true or false?</description> <content:encoded><![CDATA[<p>Why not have 2 properties (IsPanelWindowVisible and IsBusy) which you can set to true or false?</p> ]]></content:encoded> </item> <item><title>By: TDG</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49897</link> <dc:creator>TDG</dc:creator> <pubDate>Thu, 29 Jul 2010 09:13:40 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49897</guid> <description>I tend to agree with Matt, having 2 seperate methods is confusing for the developer (especially when the amount of methods is large enough to have to scroll through the suggestions).
When i see HideWindow(), the first thing i wonder is: &quot;is there also a method for hiding the window?&quot; And if there is, what will its name be? UnHideWindow? ShowWindow?
And who guarantees that HideWindow() and ShowWindow() are each others opposite? It&#039;s possible that the author of the code used confusing names for different functionality.With ShowWindow(bool isVisible) you don&#039;t have these question, you instantly see the method, its possible states and you&#039;re (well, almost) sure true does the opposite of false.
And imho that&#039;s why the boolean-version is easier to read than 2 methods... actually that&#039;s why i&#039;ve written it like that. ;)</description> <content:encoded><![CDATA[<p>I tend to agree with Matt, having 2 seperate methods is confusing for the developer (especially when the amount of methods is large enough to have to scroll through the suggestions).<br
/> When i see HideWindow(), the first thing i wonder is: &#8220;is there also a method for hiding the window?&#8221; And if there is, what will its name be? UnHideWindow? ShowWindow?<br
/> And who guarantees that HideWindow() and ShowWindow() are each others opposite? It&#8217;s possible that the author of the code used confusing names for different functionality.</p><p>With ShowWindow(bool isVisible) you don&#8217;t have these question, you instantly see the method, its possible states and you&#8217;re (well, almost) sure true does the opposite of false.<br
/> And imho that&#8217;s why the boolean-version is easier to read than 2 methods&#8230; actually that&#8217;s why i&#8217;ve written it like that. <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49579</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Tue, 27 Jul 2010 07:17:48 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49579</guid> <description>@Mattinteresting point... however, in types that you own i think it&#039;s important to keep the number of members on a class to a respectable number.  With that, i mean that it should only have members that make sense for that class, and that should (IMHO) not be a list that is so large that you needs methods to be close to each other alphabetically in order to be easily discovered.Findability/discoverability begins with a simple, clean and intuitive API. Not with IntelliSense.@Lars-Erik RoaldNot a big fan of that convention either, but Dispose(bool disposing) is at least not a public member. Not saying that it&#039;s completely ok to give non-public members &#039;bad&#039; names, but there is a good argument to be found to be more lenient about those names.</description> <content:encoded><![CDATA[<p>@Matt</p><p>interesting point&#8230; however, in types that you own i think it&#8217;s important to keep the number of members on a class to a respectable number.  With that, i mean that it should only have members that make sense for that class, and that should (IMHO) not be a list that is so large that you needs methods to be close to each other alphabetically in order to be easily discovered.</p><p>Findability/discoverability begins with a simple, clean and intuitive API. Not with IntelliSense.</p><p>@Lars-Erik Roald</p><p>Not a big fan of that convention either, but Dispose(bool disposing) is at least not a public member. Not saying that it&#8217;s completely ok to give non-public members &#8216;bad&#8217; names, but there is a good argument to be found to be more lenient about those names.</p> ]]></content:encoded> </item> <item><title>By: Lars-Erik Roald</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49576</link> <dc:creator>Lars-Erik Roald</dc:creator> <pubDate>Tue, 27 Jul 2010 06:56:29 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49576</guid> <description>This  example should be quite obvious for everybody -  we shouldn&#039;t use the first solution.
Another, more interesting case is: Dispose() and Dispose(bool disposing) . Should we get rid of that syntax? Every time I see this syntax, I need to scratch my head. Does it really need to be like this ?</description> <content:encoded><![CDATA[<p>This  example should be quite obvious for everybody &#8211;  we shouldn&#8217;t use the first solution.<br
/> Another, more interesting case is: Dispose() and Dispose(bool disposing) . Should we get rid of that syntax? Every time I see this syntax, I need to scratch my head. Does it really need to be like this ?</p> ]]></content:encoded> </item> <item><title>By: Matt</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49537</link> <dc:creator>Matt</dc:creator> <pubDate>Tue, 27 Jul 2010 03:31:10 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49537</guid> <description>Hi DaveWhilst I like what you&#039;re suggesting (code readability is becoming top of my list), what about intellisense - most devs calling the code will use intellisense to determine what they can do and being ordered alphabetically will mean the ShowPanelWindow and HidePanelWindow methods will be completely separated (causing the dev to have to hunt through before finding out what there is - of course something like resharper will help)..What I&#039;m getting at is, beyond outright readability is the issue of the tools we use - should we consider findability [or other tool-related issue] too?Of another way around this is to muddle the order so the noun comes first (i.e. PanelWindowShow and PanelWindowHide) but that isn&#039;t how we talk to people either..Thoughts?</description> <content:encoded><![CDATA[<p>Hi Dave</p><p>Whilst I like what you&#8217;re suggesting (code readability is becoming top of my list), what about intellisense &#8211; most devs calling the code will use intellisense to determine what they can do and being ordered alphabetically will mean the ShowPanelWindow and HidePanelWindow methods will be completely separated (causing the dev to have to hunt through before finding out what there is &#8211; of course something like resharper will help)..</p><p>What I&#8217;m getting at is, beyond outright readability is the issue of the tools we use &#8211; should we consider findability [or other tool-related issue] too?</p><p>Of another way around this is to muddle the order so the noun comes first (i.e. PanelWindowShow and PanelWindowHide) but that isn&#8217;t how we talk to people either..</p><p>Thoughts?</p> ]]></content:encoded> </item> <item><title>By: Tiendq</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49524</link> <dc:creator>Tiendq</dc:creator> <pubDate>Tue, 27 Jul 2010 01:49:56 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49524</guid> <description>I always prefer the longer version, it saves my time in the long run.</description> <content:encoded><![CDATA[<p>I always prefer the longer version, it saves my time in the long run.</p> ]]></content:encoded> </item> <item><title>By: Olivier</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49485</link> <dc:creator>Olivier</dc:creator> <pubDate>Mon, 26 Jul 2010 19:45:01 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49485</guid> <description>I agree intellectually with you, though I must confess I rather often write this:private bool dirty = false;private void SetDirty() { SetDirty(true); }
private void SetDirty(bool isDirty)
{
dirty = isDirty;
}In my mind, this means that SetDirty actually sets a dirty state given that with no parameter the obvious intention is to &#039;set&#039; the dirty state whereas you must explicitly provide the false value to &#039;unset&#039; it...As a side note, I hate (could not really explain why) using the &#039;this&#039; keyword when not absolutely necessary. This is why I usually use a different name for the parameter and the member...</description> <content:encoded><![CDATA[<p>I agree intellectually with you, though I must confess I rather often write this:</p><p>private bool dirty = false;</p><p>private void SetDirty() { SetDirty(true); }<br
/> private void SetDirty(bool isDirty)<br
/> {<br
/> dirty = isDirty;<br
/> }</p><p>In my mind, this means that SetDirty actually sets a dirty state given that with no parameter the obvious intention is to &#8216;set&#8217; the dirty state whereas you must explicitly provide the false value to &#8216;unset&#8217; it&#8230;</p><p>As a side note, I hate (could not really explain why) using the &#8216;this&#8217; keyword when not absolutely necessary. This is why I usually use a different name for the parameter and the member&#8230;</p> ]]></content:encoded> </item> <item><title>By: Victor Kornov</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49468</link> <dc:creator>Victor Kornov</dc:creator> <pubDate>Mon, 26 Jul 2010 18:19:12 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49468</guid> <description>It depends on the context and how those 2 methods are used but... If e.g. visibility comes as data the first version is better. I.e. ShowPanelWindow(someobj.IsVisible) is better than if(someobj.IsVisible) ShowPanelWindow() else HidePanelWindow();
There have been cases when I&#039;ve refactored such code &quot;backwards&quot; to your refactoring ;)</description> <content:encoded><![CDATA[<p>It depends on the context and how those 2 methods are used but&#8230; If e.g. visibility comes as data the first version is better. I.e. ShowPanelWindow(someobj.IsVisible) is better than if(someobj.IsVisible) ShowPanelWindow() else HidePanelWindow();<br
/> There have been cases when I&#8217;ve refactored such code &#8220;backwards&#8221; to your refactoring <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Michael Kjörling</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49447</link> <dc:creator>Michael Kjörling</dc:creator> <pubDate>Mon, 26 Jul 2010 15:42:48 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49447</guid> <description>I agree with the point of this post. Another thing; if the function in question is actually lengthy and/or complex, and/or can&#039;t easily be refactored itself for some reason, you can always make the current code private and simply create wrapper methods with more descriptive names. After all, not all methods are one-liners like the example, and while refactoring to increase readability is a good thing in most instances, sometimes there isn&#039;t time - and then, a little is clearly better than nothing.</description> <content:encoded><![CDATA[<p>I agree with the point of this post. Another thing; if the function in question is actually lengthy and/or complex, and/or can&#8217;t easily be refactored itself for some reason, you can always make the current code private and simply create wrapper methods with more descriptive names. After all, not all methods are one-liners like the example, and while refactoring to increase readability is a good thing in most instances, sometimes there isn&#8217;t time &#8211; and then, a little is clearly better than nothing.</p> ]]></content:encoded> </item> <item><title>By: Hemant</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49441</link> <dc:creator>Hemant</dc:creator> <pubDate>Mon, 26 Jul 2010 15:09:58 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49441</guid> <description>Agree. I always tell my team to avoid natural obfuscation. The way they name the code elements and write the logic, it is almost impossible to reverse engineer the real code. Forget REing the IL :D</description> <content:encoded><![CDATA[<p>Agree. I always tell my team to avoid natural obfuscation. The way they name the code elements and write the logic, it is almost impossible to reverse engineer the real code. Forget REing the IL <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49440</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Mon, 26 Jul 2010 15:05:34 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49440</guid> <description>@Hemantoh don&#039;t get me started on the naming conventions/practices of Microsoft code ;)but that doesn&#039;t mean you shouldn&#039;t use better naming in your own code</description> <content:encoded><![CDATA[<p>@Hemant</p><p>oh don&#8217;t get me started on the naming conventions/practices of Microsoft code <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p>but that doesn&#8217;t mean you shouldn&#8217;t use better naming in your own code</p> ]]></content:encoded> </item> <item><title>By: Hemant</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49439</link> <dc:creator>Hemant</dc:creator> <pubDate>Mon, 26 Jul 2010 15:03:58 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49439</guid> <description>Well... I was not aware of the SL functions since I haven&#039;t coded in SL yet. If that is the case why blame the poor developer... even Microsoft folks don&#039;t know how to talk to people :)</description> <content:encoded><![CDATA[<p>Well&#8230; I was not aware of the SL functions since I haven&#8217;t coded in SL yet. If that is the case why blame the poor developer&#8230; even Microsoft folks don&#8217;t know how to talk to people <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49436</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Mon, 26 Jul 2010 14:47:50 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49436</guid> <description>@Hemantbtw, in Silverlight, Visibility.Collapsed means =&gt; completely hide it... there is no handle to expand again</description> <content:encoded><![CDATA[<p>@Hemant</p><p>btw, in Silverlight, Visibility.Collapsed means => completely hide it&#8230; there is no handle to expand again</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49435</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Mon, 26 Jul 2010 14:46:00 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49435</guid> <description>@Hemantwould you still go for ToggleVisibility if it would only be called through code? in this particular case, it was only called from code</description> <content:encoded><![CDATA[<p>@Hemant</p><p>would you still go for ToggleVisibility if it would only be called through code? in this particular case, it was only called from code</p> ]]></content:encoded> </item> <item><title>By: Hemant</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49434</link> <dc:creator>Hemant</dc:creator> <pubDate>Mon, 26 Jul 2010 14:43:33 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49434</guid> <description>I would still go with first version but call the methods as &quot;ToggleVisibility&quot;. Then create &quot;IsVisible&quot; or &quot;Visible&quot; property and write IsVisible = !IsVisible. And the with Busy Indicator or Busy State I would go for your implementation. Visibility is typically toggled via some UI element but busy state is generally managed through code. By making visibility as Boolean you can always call it via code. Also another fact is Expand/ Collapse is not same as Show/Hide. When you collapse a control, you typically leave a handle to expand it again. Not the same with visibility.</description> <content:encoded><![CDATA[<p>I would still go with first version but call the methods as &#8220;ToggleVisibility&#8221;. Then create &#8220;IsVisible&#8221; or &#8220;Visible&#8221; property and write IsVisible = !IsVisible. And the with Busy Indicator or Busy State I would go for your implementation. Visibility is typically toggled via some UI element but busy state is generally managed through code. By making visibility as Boolean you can always call it via code. Also another fact is Expand/ Collapse is not same as Show/Hide. When you collapse a control, you typically leave a handle to expand it again. Not the same with visibility.</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49423</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Mon, 26 Jul 2010 12:48:38 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49423</guid> <description>@Roypossibly... i think the fact that it&#039;s fewer code is also something that many developers would use as an argument in favor of the first versionand there&#039;s also the fact that some developers still really don&#039;t know how to talk to people ;)</description> <content:encoded><![CDATA[<p>@Roy</p><p>possibly&#8230; i think the fact that it&#8217;s fewer code is also something that many developers would use as an argument in favor of the first version</p><p>and there&#8217;s also the fact that some developers still really don&#8217;t know how to talk to people <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Roy</title><link>http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/comment-page-1/#comment-49422</link> <dc:creator>Roy</dc:creator> <pubDate>Mon, 26 Jul 2010 12:45:47 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/2010/07/is-that-how-you-talk-to-people/#comment-49422</guid> <description>I think these practices come from the time that refactoring tools were non-existent. If you rename &quot;BusyIndicator&quot;, your code would require 2 changes instead of just the one.Thankfully it is not 1759 anymore and we can stop doing these things :)</description> <content:encoded><![CDATA[<p>I think these practices come from the time that refactoring tools were non-existent. If you rename &#8220;BusyIndicator&#8221;, your code would require 2 changes instead of just the one.</p><p>Thankfully it is not 1759 anymore and we can stop doing these things <img
src='http://d18sni7re4ly7f.cloudfront.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/21 queries in 0.015 seconds using disk: basic
Object Caching 617/618 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: d18sni7re4ly7f.cloudfront.net

Served from: davybrion.com @ 2012-05-23 12:19:51 -->
