<?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: Achtung, minen!</title>
	<atom:link href="http://www.terrainformatica.com/2009/07/achtung-minen/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.terrainformatica.com/index.php/2009/07/achtung-minen/</link>
	<description>Terra Informatica, home of embeddable html and CSS rendering engines.</description>
	<lastBuildDate>Fri, 08 Apr 2011 07:40:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: RobertS</title>
		<link>http://www.terrainformatica.com/index.php/2009/07/achtung-minen/comment-page-1/#comment-6364</link>
		<dc:creator>RobertS</dc:creator>
		<pubDate>Fri, 23 Oct 2009 22:13:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.terrainformatica.com/index.php/?p=118#comment-6364</guid>
		<description>Hi Andrew

I have been out of touch for months ... will try to devote some time to TiScript next week ..

R</description>
		<content:encoded><![CDATA[<p>Hi Andrew</p>
<p>I have been out of touch for months &#8230; will try to devote some time to TiScript next week ..</p>
<p>R</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.terrainformatica.com/index.php/2009/07/achtung-minen/comment-page-1/#comment-6358</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Tue, 25 Aug 2009 22:41:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.terrainformatica.com/index.php/?p=118#comment-6358</guid>
		<description>To Christof: 

I know two languages that have no block scope for local variables: JS and Python (they are actually surprisingly close to each other in many other areas). 

For the Python with its peculiar syntax that is probably not that bad.
But for the JS that is using C/C++/C#/Java/etc. type of syntax such thing is a huge surprise. At least for me.
When designing TIScript I hadn&#039;t even an idea that variable visibility/scope can be implemented other way in such syntax.

That dead code `if(false) { var somevar; }` in my example below will never execute and is a good chance to be removed by bytecode optimizer but its existence (smell of var) creates very bad side effect. It is just enough to write `var YourCoolNamespace = ...` somewhere in depths of your function in Galaxy far,far away and you will spend rest of your life finding who hijacks YourCoolNamespace. 

And yet this function: 
&lt;pre&gt;&lt;code&gt;function foo 
{ 
  var a = 1; 
  {  var b = 2; }
  {  var c = 3; }
}
&lt;/code&gt;&lt;/pre&gt;
in TIscript will have storage for two values in runtime and in JS by definition it will have 3 slots for all variables. If to think about recursive calls and things like closures... size matters indeed.</description>
		<content:encoded><![CDATA[<p>To Christof: </p>
<p>I know two languages that have no block scope for local variables: JS and Python (they are actually surprisingly close to each other in many other areas). </p>
<p>For the Python with its peculiar syntax that is probably not that bad.<br />
But for the JS that is using C/C++/C#/Java/etc. type of syntax such thing is a huge surprise. At least for me.<br />
When designing TIScript I hadn&#8217;t even an idea that variable visibility/scope can be implemented other way in such syntax.</p>
<p>That dead code `if(false) { var somevar; }` in my example below will never execute and is a good chance to be removed by bytecode optimizer but its existence (smell of var) creates very bad side effect. It is just enough to write `var YourCoolNamespace = &#8230;` somewhere in depths of your function in Galaxy far,far away and you will spend rest of your life finding who hijacks YourCoolNamespace. </p>
<p>And yet this function: </p>
<pre><code>function foo
{
  var a = 1;
  {  var b = 2; }
  {  var c = 3; }
}
</code></pre>
<p>in TIscript will have storage for two values in runtime and in JS by definition it will have 3 slots for all variables. If to think about recursive calls and things like closures&#8230; size matters indeed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christof</title>
		<link>http://www.terrainformatica.com/index.php/2009/07/achtung-minen/comment-page-1/#comment-6357</link>
		<dc:creator>Christof</dc:creator>
		<pubDate>Tue, 25 Aug 2009 18:47:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.terrainformatica.com/index.php/?p=118#comment-6357</guid>
		<description>On his website and in his books Doug explains quite logically why this happens. If I still get it right any var in a function defines a local variable. The if is NOT a different scope. His advice therefor was to initialize any variables used at the beginning of a function. So as the local var inside test() is a local var it is 1, and never changes the global var somevar. You probably knew that yourself... But I think if one follows especially any advice in javascript - the good parts javascript indeed is a very nice language. and regarding its history it is amazing what it is capable of...</description>
		<content:encoded><![CDATA[<p>On his website and in his books Doug explains quite logically why this happens. If I still get it right any var in a function defines a local variable. The if is NOT a different scope. His advice therefor was to initialize any variables used at the beginning of a function. So as the local var inside test() is a local var it is 1, and never changes the global var somevar. You probably knew that yourself&#8230; But I think if one follows especially any advice in javascript &#8211; the good parts javascript indeed is a very nice language. and regarding its history it is amazing what it is capable of&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bilge</title>
		<link>http://www.terrainformatica.com/index.php/2009/07/achtung-minen/comment-page-1/#comment-6356</link>
		<dc:creator>Bilge</dc:creator>
		<pubDate>Tue, 25 Aug 2009 11:12:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.terrainformatica.com/index.php/?p=118#comment-6356</guid>
		<description>There is nothing interesting about this article. I guessed what result would be returned and was correct. Not only is this how JS functions but how almost any language will function. Further, the if (false) statement is (obviously) superfluous since it can never be true, adding absolutely no value to your example either.</description>
		<content:encoded><![CDATA[<p>There is nothing interesting about this article. I guessed what result would be returned and was correct. Not only is this how JS functions but how almost any language will function. Further, the if (false) statement is (obviously) superfluous since it can never be true, adding absolutely no value to your example either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.terrainformatica.com/index.php/2009/07/achtung-minen/comment-page-1/#comment-6303</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Sun, 12 Jul 2009 18:22:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.terrainformatica.com/index.php/?p=118#comment-6303</guid>
		<description>Ooops! That sample was quite different indeed. 

Fixed, thanks a lot.</description>
		<content:encoded><![CDATA[<p>Ooops! That sample was quite different indeed. </p>
<p>Fixed, thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DmitryYakimov</title>
		<link>http://www.terrainformatica.com/index.php/2009/07/achtung-minen/comment-page-1/#comment-6302</link>
		<dc:creator>DmitryYakimov</dc:creator>
		<pubDate>Sun, 12 Jul 2009 16:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.terrainformatica.com/index.php/?p=118#comment-6302</guid>
		<description>Yeah, especially that source code from post is defferent with the actual source code. It will hurt your readers brain, I think :)</description>
		<content:encoded><![CDATA[<p>Yeah, especially that source code from post is defferent with the actual source code. It will hurt your readers brain, I think <img src='http://www.terrainformatica.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

