<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Talk Like A Duck: Tag psychology</title>
    <link>http://talklikeaduck.denhaven2.com/articles/tag/psychology</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>In Ruby, it's not the dog, it's the tricks!</description>
    <item>
      <title>Sapir-Whorf</title>
      <description>&lt;p&gt;Recently, I&amp;#8217;ve seen the &lt;a href="http://en.wikipedia.org/wiki/Sapir%E2%80%93Whorf_hypothesis"&gt;Sapir-Whorf hypothesis&lt;/a&gt; used to motivate new spins on old ideas, such as &lt;a href="http://behaviour-driven.org/GettingTheWordsRight"&gt;behavior-driven design.&lt;/a&gt; For those unfamiliar with Sapir-Whorf it comes from the school of &lt;a href="http://en.wikipedia.org/wiki/Linguistic_determinism"&gt;linquistic determnation&lt;/a&gt;, and taken to the extreme posits that a person&amp;#8217;s language determines the way he or she thinks.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m going to post some thoughts about bdd soon, but this appeal to Saphir-Whorf reminds me of an experience I had about 10 years ago.&lt;p&gt;

&lt;p&gt;At the time, I was on a tour of eastern Europe for &lt;span class="caps"&gt;IBM&lt;/span&gt;.  Our team was giving presentations on &lt;span class="caps"&gt;IBM&lt;/span&gt; software development products to developers in the former Soviet Bloc.  I found myself in a hotel bar in Budapest with Muriel, a lovely young Frenchwoman who I&amp;#8217;d met some months before and who was also one of the speakers.  I&amp;#8217;d decided to try to recover my old high school French which had been &amp;#8220;rusting&amp;#8221; for about 20 years.  We had had several discussions about the French language and how it related to English.  She had done a couple of overseas assignments with &lt;span class="caps"&gt;IBM&lt;/span&gt; in the US previously, and had worked in Connecticut with someone who had grown up in Brooklyn, which resulted in an amazingly charming and unique accent when she spoke English. We remain good friends to this day.&lt;/p&gt;
&lt;p&gt;After a short time we were joined by another IBMer who was an American on assignment in Paris.&lt;/p&gt;
&lt;h2&gt;Flashback&lt;/h2&gt;
&lt;p&gt;I&amp;#8217;d met him earlier in the day, when we were preparing for the next days session with the help of sevaral local IBMers. He had needed help in editing his Freelance presentation (I guess his secretary normally did this for him), and Muriel had done it using a Thinkpad borrowed from one of the Hungarians.&lt;/p&gt;
&lt;p&gt;After she had finished, she closed Freelance to reveal that the machine was also running Microsoft Word.  Mr. American in Paris went ballistic, since &lt;span class="caps"&gt;IBM&lt;/span&gt; had recently acquired Lotus. He couldn&amp;#8217;t understand this treason, why was the guy not using Ami Pro?  The answer was that Ami Pro didn&amp;#8217;t yet support the Hungarian language.&lt;/p&gt;
&lt;p&gt;This wasn&amp;#8217;t enough to satisfy our friend, and the Hungarian went away shaking his head.&lt;/p&gt;
&lt;h2&gt;Back to the Bar&lt;/h2&gt;
&lt;p&gt;So our friend showed up and told us that, although he&amp;#8217;d been in Paris for nearly two years, he hadn&amp;#8217;t bothered to even try to learn any French.  His theory was that there was no need since &amp;#8220;everyone you work with speaks English anyway.&amp;#8221;  Now he exposed himself as a lingustic determinist, &amp;#8220;and people who speak languages other than English can&amp;#8217;t form certain thoughts.&amp;#8221;&lt;/p&gt;
&lt;blockquote&gt;Oh really!? I said, like what?&lt;/blockquote&gt;
&lt;blockquote&gt;&amp;#8220;For instance, there&amp;#8217;s no way to say &amp;#8220;I like you in French.&amp;#8221;&lt;/blockquote&gt;
&lt;p&gt;I shot an amused look at Muriel, we&amp;#8217;d been talking about that very thing in the recent past.  Those with a surface &amp;#8220;knowledge&amp;#8221; of French think this because the verb &amp;#8220;Aimer&amp;#8221; means both &amp;#8220;to like&amp;#8221; and &amp;#8220;to love.&amp;#8221;    If you want sweet-talk a girl you say &amp;#8220;Je t&amp;#8217;aime.&amp;#8221;  Which every high-school French student, and ever sailor on shore-leave in a French-speaking port knows means, &amp;#8220;I love you.&amp;#8221;  So they figure that there&amp;#8217;s no way to say &amp;#8220;I like you&amp;#8221; since &amp;#8220;aimer&amp;#8221; is already taken.&lt;/p&gt;
&lt;p&gt;But of course there is. French isn&amp;#8217;t the &amp;#8220;language of diplomacy&amp;#8221; due to a lack of expressiveness.  One way to say I like you is &amp;#8220;Je t&amp;#8217;aime bien&amp;#8221;  which seems odd to some since the &amp;#8220;bien&amp;#8221; strengthens a verb.  That girl you&amp;#8217;re trying to sweet-talk migh reply with &amp;#8220;Je t&amp;#8217;aime bien, mais je ne t&amp;#8217;aime.&amp;#8221; or &amp;#8220;I like you but I don&amp;#8217;t love you.&amp;#8221;&lt;/p&gt;
&lt;blockquote&gt;And the Japanese don&amp;#8217;t have a word for &amp;#8220;no&amp;#8221; which is why they can&amp;#8217;t be impolite.&lt;/blockquote&gt;
&lt;p&gt;Again, this is patently false.  Anyone who watched the old mini-series whould now that one of the first words Anjin-san learned was ie which means an emphatic no.  The Japanese have lots of ways of saying no, or expressing variations of that thought, with various levels of politeness.&lt;/p&gt;
&lt;p&gt;He went on to express several similar thoughts, but my amazement at his naivet&amp;eacute; soon turned to boredom, and I tuned him out.&lt;/p&gt;
&lt;h2&gt;Does Language (Determine|Influence) Thought?&lt;/h2&gt;
&lt;p&gt;The Sapir-Worf hypothesis in it&amp;#8217;s strongest form, and more generally, linguistic determinism, are nothing if not controversial amoung psycho-linguists.  While there is some experimental evidence that language might have some influence on thinking, it doesn&amp;#8217;t seem to be as pervasive as Sapir-Worf would predict.
&lt;h2&gt;Language, Expression, and Communication&lt;/h2&gt;
&lt;p&gt;It does seem evident to me that language affects the way thoughts are expressed, and that this difference in expression can hinder communication.&lt;/p&gt;
&lt;p&gt;Take the expression of &amp;#8220;I like you&amp;#8221; in French.  Not understanding the subtleties of expression might lead to a slapped face!  I&amp;#8217;m not sure about this, but my theory about &amp;#8220;Je t&amp;#8217;aime&amp;#8221; vs. &amp;#8220;Je t&amp;#8217;aime bien&amp;#8221; is that the two phrases might be related to teachings in the Catholic church.  When I learned of the distinction, it brought back a memory from parochial school.  The parish priest was visiting the classroom, and the teacher, a nun, asked him to explain the difference between &amp;#8220;like&amp;#8221; and &amp;#8220;love.&amp;#8221;  He said that like was more than love because &amp;#8220;I have to love you, but I don&amp;#8217;t have to like you.&amp;#8221;  Because we might be talking to someone whose native language lacks the subjunctive case doesn&amp;#8217;t mean that she can&amp;#8217;t think hypothetically, and when she is trying to talk hypothetically we might not understand how she translates from her native language into English.  It actually disproves my &amp;#8220;ugly American friend&amp;#8217;s&amp;#8221;  belief that since everyone needed to do business with already speaks English, there&amp;#8217;s no need to make any effort to understand their language.
&lt;h2&gt;Now Back to our Regularly Scheduled Program&lt;/h2&gt;
&lt;p&gt;So what does all this have to dowith the usual subject matter of this blog?&lt;/p&gt;
&lt;p&gt;The answer is that this mismatch between thought and expression leads to misunderstanding even in technical matters.&lt;/p&gt;
&lt;p&gt;Someone whose &amp;#8216;native language&amp;#8217; is strongly typed can have a hard time understanding the expressive power and idioms of a dynamically typed language such as Ruby or Smalltalk, and those without knowledge of Java or C++ can have a hard time understanding those guys, and arguments can proliferate because words denote slightly different concepts in various programming languages.&lt;/p&gt;
&lt;p&gt;Different &amp;#8220;methodologies&amp;#8221; can sprout up as different groups of developers independently discover the same or similar techniques and give different names to the same concept, or the same name to different concepts, or a guru decides that a vocabulary shift is just the thing needed to explain something to a group with another mode of expression.  Some of have been using agile techniques before they were agile, or even extreme.&lt;/p&gt;
&lt;p&gt;And it can be languages vs. methodologies.  I like to use the term &amp;#8220;behavior&amp;#8221; the way Smalltalk uses it, as an abstraction for an object which contains the methods of other objects (i.e. classes and metaclasses).  I&amp;#8217;m afraid that with the rising popularity of behavior-driven development in the Ruby community, with a different meaning of behavior, I&amp;#8217;m going to have to find a new term.&lt;/p&gt;
&lt;p&gt;But more on &lt;span class="caps"&gt;BDD&lt;/span&gt; here soon.&lt;/p&gt;</description>
      <pubDate>Mon, 11 Jun 2007 16:32:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:1e83c0ab-8889-4e58-a50e-2cd0a418bf15</guid>
      <author>Rick DeNatale</author>
      <link>http://talklikeaduck.denhaven2.com/articles/2007/06/11/sapir-whorf</link>
      <category>psychology</category>
      <category>war_stories</category>
      <category>linguistics</category>
      <category>psychology</category>
    </item>
    <item>
      <title>Are you aiming at the right bug?</title>
      <description>&lt;p&gt;How many times has this happened to you?&lt;/p&gt;


	&lt;p&gt;You have a really tough bug which defies all attacks.  Finally after pondering it for hours, or days or maybe more, you realize that the symptoms you are seeing aren&amp;#8217;t due to the posited bug at all, but are really something else.&lt;/p&gt;


	&lt;p&gt;Some examples.&lt;/p&gt;


On ruby-talk, I&amp;#8217;ve been trying to help someone who was having problems making Net::SMTP work.  He had some code which included:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;smtp.open_message_stream('sender@mail.com', [&amp;quot;dummy@dummy.com&amp;quot;]) do&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
And which was working, except that he really wanted to send an email to an address held in a variable rather than &amp;#8220;dummy@dummy.com&amp;#8221;  He was getting an error if he used &amp;#8216;a&amp;#8217; variable for the recipient address, and wondered why the array couldn&amp;#8217;t take a variable.

	&lt;p&gt;At first it looked to me, based on the examples he was giving that he was trying to pass the name of the variable as a string, and I suggested that he just change that parameter to [email].  But he said that that still didn&amp;#8217;t work (actually he&amp;#8217;d already tried it.&lt;/p&gt;


	&lt;p&gt;I was getting frustrated, until he rephrased something that he had briefly mentioned in his intial post, that the error he was getting was a &amp;#8216;tainted sender&amp;#8217; error.  The problem was really that he was getting the object referenced in the variable from a web form, and the framework code he was using was, rightly, tainting these values as a protection against security exposures.  There was no problem with passing values. The solution was to untaint the object after sniff-testing it.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve done similar things in the past.  My theory of what&amp;#8217;s wrong becomes an idee fixee which blocks me from seeing the truth.&lt;/p&gt;


Two more (colorful) examples:
&lt;ol&gt;
&lt;li&gt;Some years ago I was building an application in Smalltalk which allowed for boxes to be drawn with connecting lines which were anchored to the boxes so that they moved when a box was moved. The kind of thing you need for a pert chart or other network diagram.  Everything was working until I changed the lines into separate objects, when the lines just disappeared.  I kept trying to figure out why the line objects weren&amp;#8217;t drawing, until it finally dawned on me that they actually &lt;b&gt;were&lt;/b&gt; drawing. I was using xor to draw them so that I could easily erase them in order to animate them when the boxes moved.  The only way I figured this out was because in desperation, I changed from using a black line to a red one, which allowed me to see the line being drawn, then erased as the color changed from red to cyan.  The problem wasn&amp;#8217;t in the line object at all but in the animation code which was drawing then erasing the line.&lt;/li&gt;
&lt;li&gt;More recently, I&amp;#8217;ve been playing with a Ruby application which is a Sudoku puzzle assistant, as an exercise in learning RubyTk among other things.  It displays the values of the initial squares given in the puzzle in black, and uses blue for squares which you have set yourself.  The model object for the square has a boolean instance variable named initial which is set when the puzzle is initially entered so as to show this difference.  Once the application is set in &amp;#8216;play&amp;#8217; mode no other squares should have this variable change.
&lt;p&gt;I&amp;#8217;d gotten pretty far along with this, including having commands which search for constraints on the values of squares, then apply those constraints, etc.  I&amp;#8217;d recently improved the ability to save the puzzle in a file.  My first pass just saved the initial values, more recently I&amp;#8217;d added saving the state of the solution as well.&lt;/p&gt;
&lt;p&gt;I was happily playing with testing, when I noticed that in one case finding a contraint, changed one of the squares from black to blue.  I spent several days trying to figure out why the initial status of that square was being changed.  I pulled out all kinds of Ruby-foo to figure this out. I made sure that the variable was only accessed by a reader and writer accessor methods so that I could print a backtrace when it changed, but I never could find the culprit.&lt;/p&gt;
&lt;p&gt;Of course the punchline was that there was no such culprit.  I finally realized what was happening when I, for what was probably the hundreth time, started the application and read in the test file containing the puzzle.  That&amp;#8217;s when I realized that the square in question was actually &lt;b&gt;not&lt;/b&gt; one of the squares which had a value given in the initial puzzle.  The &lt;b&gt;real&lt;/b&gt; bug turned out to be that, non-initial squares weren&amp;#8217;t being drawn correctly when the puzzle was read.  It wasn&amp;#8217;t until I did something which caused that square to be re-displayed that the value got drawn in the correct, blue, color.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Gerry Weinberg had a lot to say about such things in his thirty-six year old classic book &amp;#8220;The Psychology of Computer Programming.&amp;#8221;  He calls this psychological set, which is the tendency for us to see what we want/expect to see.  It&amp;#8217;s what makes proofreading hard, we tend to mentally read a word like &amp;#8216;dack&amp;#8217; as if it were printed &amp;#8216;duck.&amp;#8217;  He describes an experiment which showed that commented code can be harder to debug than uncommented code because most comments describe what the code is &lt;b&gt;supposed to&lt;/b&gt; do rather than what it &lt;b&gt;actually&lt;/b&gt; does.
&lt;p&gt;So the next time you get stuck on what seems like a hard debugging session, step back and consider whether your minds-eye or your pre-conceptions are blocking you from considering the real reason for the symptoms you are diagnosing.</description>
      <pubDate>Mon, 12 Mar 2007 12:26:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:df538843-d72f-487d-bb83-37ddd2682008</guid>
      <author>Rick DeNatale</author>
      <link>http://talklikeaduck.denhaven2.com/articles/2007/03/12/are-you-aiming-at-the-right-bug</link>
      <category>ruby</category>
      <category>debugging</category>
      <category>psychology</category>
    </item>
  </channel>
</rss>
