<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx</link><description>In C# you can "lift", "raise" and "hoist", and they all mean different things. To "lift" an operator is to take an operator that operates on non-nullable value types, and create from it a similar operator that operates on nullable value types. (We are</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx#9776834</link><pubDate>Thu, 18 Jun 2009 20:39:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9776834</guid><dc:creator>Tony Cox [MSFT]</dc:creator><description>&lt;p&gt;In choosing between &amp;quot;raising&amp;quot; and &amp;quot;firing&amp;quot; an event, it seems to me that &amp;quot;less bellicose sounding&amp;quot; is a far less useful criteria than &amp;quot;doesn't collide with existing common usage&amp;quot;.&lt;/p&gt;
&lt;p&gt;Since &amp;quot;raising an exception&amp;quot; is common terminology in other contexts, whereas nobody &amp;quot;fires&amp;quot; anything in other contexts that I can think of (well, except for events), surely &amp;quot;fire&amp;quot; would have been a much better choice.&lt;/p&gt;
&lt;p&gt;&amp;quot;Triggered&amp;quot; or &amp;quot;activated&amp;quot; might also have been reasonable alternatives.&lt;/p&gt;
&lt;p&gt;Sometimes when writing a spec, you need a good thesaurus to hand...&lt;/p&gt;
</description></item><item><title>re: Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx#9777639</link><pubDate>Fri, 19 Jun 2009 00:59:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9777639</guid><dc:creator>Pavel Minaev [MSFT]</dc:creator><description>&lt;p&gt;Oh, if you only knew the woes of translating &amp;quot;raising the event&amp;quot; (or &amp;quot;firing&amp;quot; one, for that matter) to Russian! Or, say, the difference between &amp;quot;statement&amp;quot; and &amp;quot;operator&amp;quot;...&lt;/p&gt;
&lt;p&gt;It's actually something worth keeping in mind - no matter how clear you can get it for English speakers, other languages will still have its own problems that you can't really anticipate in advance.&lt;/p&gt;
</description></item><item><title>re: Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx#9779523</link><pubDate>Fri, 19 Jun 2009 08:20:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9779523</guid><dc:creator>Joe</dc:creator><description>&lt;p&gt;@pminaev - you could just do what the Germans do: mangle your language and shove in English words everywhere! &amp;nbsp;Then you end up with lovely expressions like &amp;quot;das Exception throwen&amp;quot; (instead of: die Ausnahme ausloesen) and &amp;quot;das Event raisen&amp;quot; (instead of: das Ereignis ausloesen). &amp;nbsp;It sounds as horrid to the ear as it looks to the eye, but I suppose it's better than when people use the wrong word and end up saying things like &amp;quot;throw the event&amp;quot; which just makes you go &amp;quot;huh?&amp;quot; &amp;nbsp;It also doesn't help that whoever translated the C# reference into German wasn't at all bothered by turning &amp;quot;throw&amp;quot; and &amp;quot;raise&amp;quot; into the same word (ausloesen).&lt;/p&gt;
</description></item><item><title>re: Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx#9782134</link><pubDate>Fri, 19 Jun 2009 10:42:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9782134</guid><dc:creator>Denis</dc:creator><description>&lt;P&gt;@pminaev, @Joe - whatever you do, don't use the online translators: once, just for the fun of it, I tried to type some English text into one such program (can't remember which one), translate it to the Chinese, and then the result - back to English. If only the program is not smart enought to simply revert to your original under such circumstances, the result is really educational - try it yourselves! And don't choose some closely related laguages, like Spanish and Portuguese, or Russian and Ukrainian - that's no fun! :-)&lt;/P&gt;
&lt;DIV class=yellowbox&gt;
&lt;P&gt;There are many apocryphal but funny stories about machine translation gone bad. Two of my favourite legends: "out of sight, out of mind" (an English idiom meaning "if&amp;nbsp;you cannot see it then&amp;nbsp;you&amp;nbsp;will eventually forget about it") gets translated to Japanese and then back to English, and comes back as "the blind people are insane".&amp;nbsp;Or "the spirit is willing but the flesh is weak" (meaning "I wish to do something that I am not physically able to do") round-trips through Russian to "the vodka is&amp;nbsp;fine but the ham&amp;nbsp;has spoiled". -- Eric&lt;/P&gt;&lt;/DIV&gt;</description></item><item><title>re: Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx#9783248</link><pubDate>Fri, 19 Jun 2009 11:38:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9783248</guid><dc:creator>Steven</dc:creator><description>&lt;p&gt;I once accidentally installed the Dutch .NET version on my development PC. It was terrible. The C# compiler errors were all given Dutch. Even terms like &amp;quot;overloaded” (as in overloaded methods) were translated to Dutch. But not a single Dutch programmer uses a Dutch translation of &amp;quot;overloaded&amp;quot; (translated to &amp;quot;overbelast&amp;quot; in .NET) and while I'm Dutch, it was like reading German :-)&lt;/p&gt;
</description></item><item><title>re: Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx#9783977</link><pubDate>Fri, 19 Jun 2009 12:32:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9783977</guid><dc:creator>Doeke Zanstra</dc:creator><description>&lt;p&gt;In vb6 speak, one raises events. So that's a bit old school. But in the entire web, we talk about firing events. Also Google thinks &amp;quot;fire events&amp;quot; (96.8 M hits) &amp;nbsp;is bigger than &amp;quot;raise events&amp;quot; (50.4 M hits). Although substantial, I wonder for how long you can keep it up ;-)&lt;/p&gt;
</description></item><item><title>re: Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx#9784337</link><pubDate>Fri, 19 Jun 2009 12:53:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9784337</guid><dc:creator>askitanna</dc:creator><description>&lt;p&gt;can anybody say me the meaning for the qoute below the title &lt;/p&gt;
&lt;p&gt;&amp;quot;Use your legs, not your back&amp;quot; &amp;nbsp;&lt;/p&gt;
</description></item><item><title>re: Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx#9784603</link><pubDate>Fri, 19 Jun 2009 13:06:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9784603</guid><dc:creator>Daniel Earwicker</dc:creator><description>&lt;p&gt;@askitanna - it's good advice when lifting a heavy object.&lt;/p&gt;
&lt;p&gt;(I guess a heavy object would be one with a finalizer?)&lt;/p&gt;
</description></item><item><title>re: Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx#9791909</link><pubDate>Fri, 19 Jun 2009 22:19:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9791909</guid><dc:creator>TubbyHubby</dc:creator><description>&lt;p&gt;@askitanna - Whenever you lift (or hoist or raise) something heavy, you should take a stance that allows you to use the strength of your legs, not your back, for safety purposes. &amp;nbsp;In the US, it is very common to simply say &amp;quot;Use your legs, not your back&amp;quot; to describe the entire safe method of getting something heavy up off the ground.&lt;/p&gt;
</description></item><item><title>re: Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx#9793462</link><pubDate>Sat, 20 Jun 2009 14:23:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9793462</guid><dc:creator>Denis</dc:creator><description>&lt;p&gt;The funniest story I ever heard about the machine translations was the name Osama Bin Laden coming out as &amp;quot;Osama the Loaded Rubbish Container&amp;quot; (as an explanation, think the Recycle BIN on your Windows desktop, and the word &amp;quot;laden&amp;quot;, adjective, is self-explanatory)&lt;/p&gt;
</description></item><item><title>re: Use your legs, not your back</title><link>http://blogs.msdn.com/ericlippert/archive/2009/06/18/use-your-legs-not-your-back.aspx#9806758</link><pubDate>Sat, 27 Jun 2009 23:50:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806758</guid><dc:creator>Alex</dc:creator><description>&lt;P&gt;Hi, Eric&lt;/P&gt;
&lt;P&gt;You said that hoising captures local variables (hope I'm not putting words in your mouth), but I did some research of my own and found out that it is not true.&lt;/P&gt;
&lt;P&gt;I wrote some code along these lines to look into the matter:&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;var toBeHoisted = 1;&lt;BR&gt;Func&amp;lt;int, int&amp;gt; f = a =&amp;gt; a + toBeHoisted;&lt;BR&gt;var before = f(1);&lt;BR&gt;toBeHoisted = 2;&lt;BR&gt;var after = f(1);&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;I would assume that since that variable got "hoisted", a snapshot of it was made in function "f" (it was captured in your words) and variables "after" and "before" should have coincided, but they did not !&lt;/P&gt;
&lt;P&gt;Then I wrote this code:&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;var toBeHoisted = 1;&lt;BR&gt;Func&amp;lt;int, int&amp;gt; f = a =&amp;gt; {toBeHoisted += 1; return a + toBeHoisted;};&lt;BR&gt;f(1);&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;Again I was in for a surprise, I had thought that variable "toBeHoisted" would not be changed from the anonymous delegate, but it was !&lt;/P&gt;
&lt;P&gt;[[ The &lt;STRONG&gt;variable&lt;/STRONG&gt; &lt;STRONG&gt;itself&lt;/STRONG&gt; is captured, not the &lt;STRONG&gt;value&lt;/STRONG&gt; of the variable. When you make a change to the variable in one place, &lt;STRONG&gt;everyone that captured that variable sees the change.&lt;/STRONG&gt; Now is it clear why what you're seeing is expected. -- Eric ]]&lt;/P&gt;</description></item></channel></rss>