<?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>Matthew Turland &#187; Programming Languages</title>
	<atom:link href="http://matthewturland.com/tag/programming-languages/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthewturland.com</link>
	<description></description>
	<lastBuildDate>Tue, 24 Jan 2012 04:03:47 +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>The Yin and Yang of Typing</title>
		<link>http://matthewturland.com/2008/01/20/the-yin-and-yang-of-typing/</link>
		<comments>http://matthewturland.com/2008/01/20/the-yin-and-yang-of-typing/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 04:33:53 +0000</pubDate>
		<dc:creator>Matthew Turland</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[Programming Languages]]></category>

		<guid isPermaLink="false">http://ishouldbecoding.com/2008/01/19/the-yin-and-yang-of-typing/</guid>
		<description><![CDATA[Without a little background in programming languages or computer science in general, it&#8217;s entirely possible that typing systems are not something that have crossed your mind. I thought I&#8217;d take a blog entry to share some of my thoughts on how it&#8217;s affecting the creation and evolution of languages. First of all, Benjamin C. Pierce [...]]]></description>
			<content:encoded><![CDATA[<p>Without a little background in programming languages or computer science in general, it&#8217;s entirely possible that <a title="Type system - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Type_system">typing systems</a> are not something that have crossed your mind. I thought I&#8217;d take a blog entry to share some of my thoughts on how it&#8217;s affecting the creation and evolution of languages.</p>
<p>First of all, <a title="Benjamin C. Pierce - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Benjamin_C._Pierce">Benjamin C. Pierce</a> probably has <a title="Strongly-typed programming language - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Strong_typing#Interpretation">a point</a>: terminology used to refer to typing concepts is about as useful as buzzwords like <a title="Ajax (programming) - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">AJAX</a> or <a title="Web 2.0 - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Web_2.0#Defining_.22Web_2.0.22">Web 2.0</a> these days. Be that as it may, I&#8217;m going to reach back into the recesses of what I recall from the <a title="CMPS 450: Programming Languages" href="http://louisiana.edu/Academic/Sciences/CMPS/curriculum/crsdesc/450.pdf">programming languages course</a> I took in college to recall some of this terminology.</p>
<p>If you aren&#8217;t familiar with <a title="Type system - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Static_typing#Static_typing">static</a> versus <a title="Type system - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Dynamic_typing#Dynamic_typing">dynamic</a> typing or <a title="Strongly-typed programming language - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Strong_typing">strong</a> versus <a title="Weak typing - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Weak_typing">weak</a> typing, it may be worth it to read up on those before proceeding with the rest of this blog entry. Here are a few examples of each:</p>
<ul>
<li>Static/weak &#8211; <a title="C (programming language) - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/C_programming_language">C</a></li>
<li>Static/strong &#8211; <a title="Java (programming language) - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Java_programming_language">Java</a></li>
<li>Dynamic/weak &#8211; <a title="PHP - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/PHP">PHP </a></li>
<li>Dynamic/strong &#8211; <a title="Python (programming language) - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Python_programming_language">Python</a></li>
</ul>
<p>The line between strong versus weak typing seems to be blurred as languages like these evolve. The reason for this is that each side of typing has its advantages. Strong typing allows for compile-time checking, which can serve to eliminate human error, as well as performance optimizations from being aware of types at compile-time. They can also serve to make source code more intuitive to follow in some respects. Weak typing, on the other hand, can allow for higher levels of abstraction and, by proxy, the need for less code in order to allow identical operations to be executed on multiple types. It can also allow for things like <a title="PHP: Variable variables - Manual" href="http://www.php.net/manual/en/language.variables.variable.php">variable variables</a>, <a title="PHP: Variable functions - Manual" href="http://www.php.net/manual/en/functions.variable-functions.php">variable functions</a>, and other interesting features not possible in strongly-typed languages.</p>
<p>Yet languages on either side of the proverbial fence are drawing in strengths from the other side. Java, before limited to the flexibility that could be provided by <a title="Polymorphism (computer science) - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Polymorphism_%28computer_science%29">polymorphism</a> while still maintaining strong typing, introduced <a title="Generics" href="http://download.oracle.com/javase/1.5.0/docs/guide/language/generics.html">generics</a> in 1.5, whereby typing was still enforced but a higher level of logic abstraction was enabled for developers. By the same token, PHP has had explicit <a title="PHP: Type Juggling - Manual" href="http://www.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting">typecasting</a> for a while and more recently in 5.1 introduced <a title="PHP: Type Hinting - Manual" href="http://www.php.net/manual/en/language.oop5.typehinting.php">type hinting</a> for array and object types (which may extend to scalar types in later versions). C# in 3.5 adds <a title="Type inference != Dynamic typing - the blog =&lt; anything goes" href="http://msmvps.com/blogs/senthil/archive/2007/11/19/type-inference-dynamic-typing.aspx">type inferencing</a>, which while it&#8217;s only syntactic sugar at least alleviates the need for verbosity when performing the most common method of initialization (i.e. setting a variable of a given class to an object instance of that class, as opposed to one involving a subclass of one or more of the classes involved).</p>
<p>It&#8217;s also becoming commonplace for dynamically typed language interpreters to get ported to Java and .NET in order to leverage the features of those languages and the native libraries of the host language in the existing execution environment. Take these examples for instance.</p>
<ul>
<li><a href="http://quercus.caucho.com/">Quercus</a> (Java) and <a href="http://php-compiler.net">Phalanger</a> (.NET) for <a href="http://php.net/">PHP</a></li>
<li><a href="http://www.jruby.org/">JRuby</a> (Java) and <a href="http://www.ironruby.net/">IronRuby</a> (.NET) for <a href="http://www.ruby-lang.org/en/">Ruby</a></li>
<li><a href="http://www.jython.org/">Jython</a> (Java) and <a href="http://www.codeplex.com/IronPython">IronPython</a> (.NET) for <a href="http://python.org/">Python</a></li>
</ul>
<p>In short, some level of control over typing is obviously a desired feature in any useful language. As well, I don&#8217;t think a language can be truly useful without having a bit of both worlds to some degree. The reason for the existence of programming languages is to enable developers to control machines whose primary purpose is to manipulate data (and, as has been pointed out many times before, are stupid and do what we tell them to do). If control over said manipulation is hampered by the typing system, it hampers the effectiveness of the language. In this, I have to agree with <a title="Ludwig Wittgenstein - Wikiquote" href="http://en.wikiquote.org/wiki/Ludwig_Wittgenstein">Ludwig Wittgenstein</a>, who said, &#8220;The limits of my language mean the limits of my world.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewturland.com/2008/01/20/the-yin-and-yang-of-typing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
