<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>therning.org/ magnus &#187; linux journal</title>
	<atom:link href="http://therning.org/magnus/archives/tag/linux_journal/feed" rel="self" type="application/rss+xml" />
	<link>http://therning.org/magnus</link>
	<description>Incoherent mumblings</description>
	<lastBuildDate>Sun, 05 Sep 2010 21:59:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Comment to &#8220;A Look at Lua&#8221;</title>
		<link>http://therning.org/magnus/archives/292</link>
		<comments>http://therning.org/magnus/archives/292#comments</comments>
		<pubDate>Fri, 01 Jun 2007 08:37:46 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[linux journal]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://therning.org/magnus/archives/292</guid>
		<description><![CDATA[In the June issue of Linux Journal (#158) there&#8217;s an article on Lua in which the author compares it to Python. The article is only available to subscribers at the moment, so I decided to post my comment here as well. &#8220;There is no need to worry about different types of integers.&#8221; There is non [...]]]></description>
			<content:encoded><![CDATA[<p>In the June issue of Linux Journal (#158) there&#8217;s an <a href="http://interactive.linuxjournal.com/article/9605">article</a> on <a href="http://www.lua.org/">Lua</a>
in which the author compares it to Python.  The article is only available to
subscribers at the moment, so I decided to post my comment here as well.</p>

<ol>
<li><p><em>&#8220;There is no need to worry about different types of integers.&#8221;</em>  There is non need to do that in Python either nowadays.  The conversion between &#8220;regular integers&#8221; and long ones is done automagically.  Take the following function:</p>

<pre><code>def frac(n):
    if n == 0: return 1
    else: return n * frac(n - 1)
</code></pre>

<p>Evaluating <code>frac(10)</code> gives the result <code>3628800</code> while <code>frac(30)</code> returns <code>265252859812191058636308480000000L</code>.</p></li>
<li><p><em>&#8220;You can add a float, long integer or a double to any other type of integer or number without a hitch in Lua. In contrast, doing this can cause programs written in Python 2.4 or older versions to crash.&#8221;</em>  Really?  I&#8217;ve never heard of this problem.  Do you have any references?</p></li>
<li><p><em>&#8220;In contrast to Python, Lua does not focus on 100% backward compatibility.&#8221;</em>  That Python would focus on 100% backward compatibility is just plain wrong.  Code I&#8217;ve written broke when moving from version 2.4 to 2.5 due to changes in generators.  This is the only time I&#8217;ve personally been bitten by it but every version of Python has broken something from earlier versions.  AFAIU Python 3000 will break a whole lot of older Python programs.</p></li>
<li><p><em>&#8220;Unlike Python, global variables do not need to be declared.&#8221;</em>  They don&#8217;t need to be declared at all, not on a global level.  If a function wants to access a global variable then <em>it</em> has to declare it as global.  Contrast that to the following point.</p></li>
<li><p><em>&#8220;Exactly the opposite of Python, most variables in Lua are global by default, and you must declare the variable &#8220;local&#8221; to make it a local variable rather than assuming that all variables are local.&#8221;</em>  Variables in Python are local by default, which in my experience better reflect how variables are used by programmers.</p></li>
<li><p><em>&#8220;The for loop is a little more complex in Python than it is in Lua, because Python needs to know the key to be able to get the key&#8217;s value.&#8221;</em> It&#8217;s possible to iterate over both key and value in Python as well:</p>

<pre><code>h = {1:'hello', 2:'world'}
for k, v in h.iteritems():
    print k, v
</code></pre></li>
</ol>

<p>In general it&#8217;s a good article, it shows off some interesting points in Lua.  In order to make a comparison between two languages it&#8217;s necessary to have <code>very</code> good knowledge of both languages, otherwise there&#8217;s a real risk that one language is the favourite simply because the author knows that one the best.  This piece definitely suffers from that.</p>

<p>I believe it would have been better without the author&#8217;s personal opinions on aesthetics sprinkled across the piece.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://therning.org/magnus/archives/292/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux and explaining the Swedish(-speaking) people</title>
		<link>http://therning.org/magnus/archives/91</link>
		<comments>http://therning.org/magnus/archives/91#comments</comments>
		<pubDate>Wed, 04 Jan 2006 11:45:29 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux journal]]></category>

		<guid isPermaLink="false">http://therning.org/magnus/?p=91</guid>
		<description><![CDATA[I found the following in Linux Journal. It can be found on this page, I&#8217;ve copied it verbatim since I couldn&#8217;t find a link that leads straight to the interesting part! Might Be Just Right by Doc Searls At LinuxWorld in Boston earlier this year, I got together with an old Swedish friend. She&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>I found the following in <a href="http://www.linuxjournal.com/">Linux Journal</a>. It can be found on <a href="http://www.linuxjournal.com/article/8542">this page</a>, I&#8217;ve copied it verbatim since I couldn&#8217;t find a link that leads straight to the interesting part!</p>

<h3>Might Be Just Right</h3>

<p>by Doc Searls</p>

<p>At LinuxWorld in Boston earlier this year, I got together with an old Swedish friend. She&#8217;s a nurse, not a technologist, but she was curious about my work and the conference that brought me to town. Somewhere in the midst of my explanation of Linux and its virtues, she said, &#8220;Ah, Linux is lagom&#8221;. She explained that lagom is a Swedish term that conveys a sense of balance, proportion and appropriateness. &#8220;Not too much, not too little&#8230;just right.&#8221;</p>

<p>When I told her that Linus Torvalds&#8217; first language and surname were both Swedish, she said, &#8220;Well of course. There you go.&#8221; (I&#8217;m half-Swedish myself, though I&#8217;m not sure that matters.)</p>

<p>So I put the question &#8220;Is Linux logom?&#8221; to The Man Himself in an e-mail. He debugged my spelling and declined to commit:</p>

<blockquote>
  <p>Lagom, with an &#8220;a&#8221;.</p>
  
  <p>And yes, it means &#8220;just right&#8221;, in the sense of &#8220;not too much, not too little&#8221;. See <a href="http://en.wikipedia.org/wiki/Lagom">en.wikipedia.org/wiki/Lagom</a></p>
</blockquote>

<p>Then he added, in a following e-mail:</p>

<blockquote>
  <p>They still end up confusing &#8220;lagom&#8221; with finding the &#8220;optimal&#8221; amount. That&#8217;s pretty much missing the point. It&#8217;s not that something is &#8220;lagom&#8221; because it&#8217;s the best possible or &#8220;optimal&#8221;. Quite the reverse. Something being &#8220;lagom&#8221; very much involves not caring too much about what the optimal amount even is. Or possibly questions where &#8220;optimal&#8221; simply doesn&#8217;t make sense.</p>
</blockquote>

<p>So I began checking other sources. The best I found was from &#8220;In Other Words&#8221;, published in AskOxford, published by the Oxford English Dictionary (<a href="http://www.askoxford.com/worldofwords/wordfrom/otherwords">www.askoxford.com/worldofwords/wordfrom/otherwords</a>). It lists lagom among a handful of &#8220;the most insightful, intriguing, and satisfying expressions on the planet-for which there are no English equivalents&#8221;. It says:</p>

<blockquote>
  <p>Swedish commentator Dr Bengt Gustavsson argued that the lagom mentality can be seen as the trait that gives Swedish society its characteristic stability and yet an openness to external influences. The word alludes subconsciously to the avoidance of both conspicuous success and humiliating failure, which is deeply ingrained in the Swedish psyche. It is the inclination among Swedes to shun ostentation, accept modest rewards, be good team players-to fly beneath the radar.</p>
</blockquote>

<p><i>Beneath the Radar</i> was also the title of Bob Young&#8217;s book about starting and guiding Red Hat to success. Coincidence?</p>

<p>Perhaps characteristically, Linus adds these final words to the matter: &#8220;but whether that applies to Linux I have no idea.&#8221;</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://therning.org/magnus/archives/91/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
