<?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>Programmer&#039;s Paradox &#187; Languages</title>
	<atom:link href="http://www.programmersparadox.com/category/languages/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.programmersparadox.com</link>
	<description></description>
	<lastBuildDate>Wed, 07 Dec 2011 15:18:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Helpful Erlang Tidbits</title>
		<link>http://www.programmersparadox.com/2011/01/17/helpful-erlang-tidbits/</link>
		<comments>http://www.programmersparadox.com/2011/01/17/helpful-erlang-tidbits/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 02:33:58 +0000</pubDate>
		<dc:creator>Mark Mzyk</dc:creator>
				<category><![CDATA[Languages]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[erlang]]></category>

		<guid isPermaLink="false">http://www.programmersparadox.com/?p=1288</guid>
		<description><![CDATA[I found this information useful while working my way through the Erlang in Practice screencasts. All of these apply in the interactive shell (erl). Find the Erlang version you&#8217;re running: erlang:system_info(otp_release). To clear a variable/binding, so it can be used again: f(variable_to_clear). Show all the running erlang processes: erlang:processes(). Find more useful tips from Joe (such [...]<p><br/><br/><a href="http://www.programmersparadox.com/2011/01/17/helpful-erlang-tidbits/">Helpful Erlang Tidbits</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I found this information useful while working my way through the <a href="http://pragprog.com/screencasts/v-kserl/erlang-in-practice">Erlang in Practice</a> screencasts. All of these apply in the interactive shell (erl).</p>
<p>Find the Erlang version you&#8217;re running:</p>
<p><code>erlang:system_info(otp_release).</code></p>
<p>To clear a variable/binding, so it can be used again:</p>
<p><code>f(variable_to_clear).</code></p>
<p>Show all the running erlang processes:</p>
<p><code>erlang:processes().</code></p>
<p>Find more <a href="http://www.joeandmotorboat.com/2008/07/29/a-couple-erlang-tips/">useful tips from Joe</a> (such as how to ping a node with a dash in the name).</p>
<p><br/><br/><a href="http://www.programmersparadox.com/2011/01/17/helpful-erlang-tidbits/">Helpful Erlang Tidbits</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.programmersparadox.com/2011/01/17/helpful-erlang-tidbits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Language Design Philosophies</title>
		<link>http://www.programmersparadox.com/2009/06/21/language-design-philosophies/</link>
		<comments>http://www.programmersparadox.com/2009/06/21/language-design-philosophies/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 22:05:27 +0000</pubDate>
		<dc:creator>Mark Mzyk</dc:creator>
				<category><![CDATA[Languages]]></category>
		<category><![CDATA[design philosophies]]></category>
		<category><![CDATA[programming languages]]></category>

		<guid isPermaLink="false">http://www.programmersparadox.com/?p=884</guid>
		<description><![CDATA[In a conversation with a coworker, we distilled several programming languages&#8217; design philosophies down to a single sentence. Here&#8217;s what we came up with: Java: Protect the Developer From Themselves Ruby: Be the Developer&#8217;s Language Python: There is One True Way PHP: eh Do you agree? Disagree? What are the one sentence philosophies behind other [...]<p><br/><br/><a href="http://www.programmersparadox.com/2009/06/21/language-design-philosophies/">Language Design Philosophies</a></p>
]]></description>
			<content:encoded><![CDATA[<p>In a conversation with a coworker, we distilled several programming languages&#8217; design philosophies down to a single sentence.</p>
<p>Here&#8217;s what we came up with:</p>
<p><strong>Java</strong>: Protect the Developer From Themselves</p>
<p><strong>Ruby</strong>: Be the Developer&#8217;s Language</p>
<p><strong>Python</strong>: There is One True Way</p>
<p><strong>PHP</strong>: eh</p>
<p>Do you agree? Disagree?  What are the one sentence philosophies behind other languages that we didn&#8217;t touch on?</p>
<p><br/><br/><a href="http://www.programmersparadox.com/2009/06/21/language-design-philosophies/">Language Design Philosophies</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.programmersparadox.com/2009/06/21/language-design-philosophies/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>NPR on the Sapir-Whorf Hypothesis</title>
		<link>http://www.programmersparadox.com/2009/04/12/npr-on-the-sapir-whorf-hypothesis/</link>
		<comments>http://www.programmersparadox.com/2009/04/12/npr-on-the-sapir-whorf-hypothesis/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 01:27:02 +0000</pubDate>
		<dc:creator>Mark Mzyk</dc:creator>
				<category><![CDATA[Languages]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[knowing and doing]]></category>
		<category><![CDATA[npr]]></category>
		<category><![CDATA[sapir-whorf]]></category>
		<category><![CDATA[shakespeare]]></category>

		<guid isPermaLink="false">http://www.programmersparadox.com/?p=726</guid>
		<description><![CDATA[A while back I wrote about the Sapir-Whorf hypothesis.  In a serendipitous coincidence, NPR ran a story recently that directly relates to the Sapir-Whorf hypothesis: Shakespeare Had Roses All Wrong.  While the Sapir-Whorf hypothesis isn&#8217;t mentioned, it clearly is involved. The story touches on languages and how gender in languages affects thinking.  It is highlighted [...]<p><br/><br/><a href="http://www.programmersparadox.com/2009/04/12/npr-on-the-sapir-whorf-hypothesis/">NPR on the Sapir-Whorf Hypothesis</a></p>
]]></description>
			<content:encoded><![CDATA[<p>A while back I wrote about the <a href="http://www.programmersparadox.com/2009/02/27/sapir-whorf-hypothesis/">Sapir-Whorf hypothesis</a>.  In a serendipitous coincidence, NPR ran a story recently that directly relates to the Sapir-Whorf hypothesis: <a href="http://www.npr.org/templates/story/story.php?storyId=102518565">Shakespeare Had Roses All Wrong</a>.  While the Sapir-Whorf hypothesis isn&#8217;t mentioned, it clearly is involved.</p>
<p>The story touches on languages and how gender in languages affects thinking.  It is highlighted that Spanish speakers and Germany speakers pick different adjectives to describe a bridge, based on the fact that in one language a bridge is male, in the other, female.</p>
<p>The story goes on to talk about how scientists set up an experiment to determine if it was language that the differences could be attributed to.  They determined it is language and that you can shift people&#8217;s thinking by teaching them a language that uses different gender constructs.</p>
<p>The story then goes on to talk about Shakespeare&#8217;s famous line: A rose by any other name would smell as sweet.</p>
<p>Here&#8217;s the actual, full quote:</p>
<blockquote><p>What&#8217;s in a name? that which we call a rose<br />
By any other name would smell as sweet<br />
-<a href="http://www.bartleby.com/70/3822.html">Act II, Scene II. Romeo and Juliet</a></p></blockquote>
<p>It&#8217;s a very interesting story and well worth the seven minutes it takes to listen to.</p>
<p>As an added bonus, <a href="http://www.cs.uni.edu/~wallingf/blog/archives/monthly/2009-04.html#e2009-04-12T18_46_21.htm">Knowing and Doing just posted a post titled Language Driven Programming</a>, which tackles many of the same themes and applies them to programming languages.</p>
<p><br/><br/><a href="http://www.programmersparadox.com/2009/04/12/npr-on-the-sapir-whorf-hypothesis/">NPR on the Sapir-Whorf Hypothesis</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.programmersparadox.com/2009/04/12/npr-on-the-sapir-whorf-hypothesis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Java.beyond</title>
		<link>http://www.programmersparadox.com/2008/09/14/javabeyond/</link>
		<comments>http://www.programmersparadox.com/2008/09/14/javabeyond/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 21:45:42 +0000</pubDate>
		<dc:creator>Mark Mzyk</dc:creator>
				<category><![CDATA[Languages]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Java.next]]></category>
		<category><![CDATA[Stuart Halloway]]></category>

		<guid isPermaLink="false">http://www.programmersparadox.com/?p=309</guid>
		<description><![CDATA[Today&#8217;s title is a play off of Stuart Halloway&#8217;s current series of blog posts titled Java.next.  Stuart is focusing his series on the set of languages that run on the JVM and are looking to replace (or if not replace, then gain dominance alongside) Java. In the third part of the series, Dispatch, Stuart writes [...]<p><br/><br/><a href="http://www.programmersparadox.com/2008/09/14/javabeyond/">Java.beyond</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s title is a play off of Stuart Halloway&#8217;s <a href="http://blog.thinkrelevance.com/2008/8/4/java-next-common-ground">current series of blog posts titled Java.next</a>.  Stuart is focusing his series on the set of languages that <em>run on the JVM</em> and are looking to replace (or if not replace, then gain dominance alongside) Java.</p>
<p>In the third part of the series, <a href="http://blog.thinkrelevance.com/2008/8/26/java-next-3-dispatch-2">Dispatch</a>, Stuart writes about ways the Java.next languages dynamically choose behavior, one such way being with the switch statement.  Stuart provides examples in Ruby (technically he should have used JRuby), Groovy, Clojure, and Scala.  Stuart explores further than just the switch statement, but it was the switch statement example that caught my eye.</p>
<p>The example for each language is a simple piece of code that takes a grade (either numeric or letter) and returns the letter equivalent.  If passed a 95, the code returns A.  If passed 55, it returns F.  If passed B, it returns B.  If passed something that doesn&#8217;t equate to a valid grade, it throws an error.</p>
<p>I couldn&#8217;t resist coding it in Erlang.</p>
<p>Here is what I came up with:</p>
<p><code> </code></p>
<pre>-module(grades).
-export([grades/1]).

grades(N) -&gt;
  case N of
    N when is_integer(N), N &gt;= 90 -&gt; "A";
    N when is_integer(N), N &gt;= 80 -&gt; "B";
    N when is_integer(N), N &gt;= 70 -&gt; "C";
    N when is_integer(N), N &gt;= 60 -&gt; "D";
    N when is_integer(N), N &gt;= 0  -&gt; "F";
    "A" -&gt; "A";
    "a" -&gt; "A";
    "B" -&gt; "B";
    "b" -&gt; "B";
    "C" -&gt; "C";
    "c" -&gt; "C";
    "D" -&gt; "D";
    "d" -&gt; "D";
    "F" -&gt; "F";
    "f" -&gt; "F";
    N when true -&gt; throw("Not a valid grade")
 end.</pre>
<p>Now for the embarrassing admission: this code took me way longer to complete than it should have.  I couldn&#8217;t remember the proper syntax for anything and I kept attempting to code Erlang like I was coding Python.  I&#8217;m sure it&#8217;s not done the Erlang way and that I&#8217;ve missed someway to make it more compact.  However, the code does work.</p>
<p>If you have a better solution, please submit it in the comments.  If something can be improved, I always welcome knowing how.</p>
<p><br/><br/><a href="http://www.programmersparadox.com/2008/09/14/javabeyond/">Java.beyond</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.programmersparadox.com/2008/09/14/javabeyond/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>PHP REPL</title>
		<link>http://www.programmersparadox.com/2008/08/26/php-repl/</link>
		<comments>http://www.programmersparadox.com/2008/08/26/php-repl/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 16:44:31 +0000</pubDate>
		<dc:creator>Mark Mzyk</dc:creator>
				<category><![CDATA[Languages]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[repl]]></category>

		<guid isPermaLink="false">http://www.programmersparadox.com/?p=241</guid>
		<description><![CDATA[I&#8217;ve mentioned before that I think programming languages should have a REPL (Read-Eval-Print-Loop). Unfortunately, PHP does not have one natively.  However, I just discovered that Facebook has opened sourced a REPL for PHP &#8211; so now you can test out your PHP code without needing to write and run a script. Working in Python, I&#8217;ve [...]<p><br/><br/><a href="http://www.programmersparadox.com/2008/08/26/php-repl/">PHP REPL</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve mentioned before that <a href="http://www.programmersparadox.com/2008/01/22/your-first-programming-language-needs-a-repl/">I think programming languages should have a REPL</a> (Read-Eval-Print-Loop).</p>
<p>Unfortunately, PHP does not have one natively.  However, I just discovered that <a href="http://www.phpsh.org/">Facebook has opened sourced a REPL for PHP</a> &#8211; so now you can test out your PHP code without needing to write and run a script.</p>
<p>Working in Python, I&#8217;ve found Python&#8217;s REPL highly convenient, so I&#8217;m going to start using Facebook&#8217;s PHP REPL for when I have to work in PHP.</p>
<p>Ironically, Facebook&#8217;s PHP REPL is implement in Python. I can commiserate: given the choice between Python and PHP, I&#8217;d go with Python.</p>
<p><br/><br/><a href="http://www.programmersparadox.com/2008/08/26/php-repl/">PHP REPL</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.programmersparadox.com/2008/08/26/php-repl/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

