<?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&#039;s Workbench &#187; Programming</title>
	<atom:link href="http://www.matthewsworkbench.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matthewsworkbench.com</link>
	<description></description>
	<lastBuildDate>Wed, 04 Jan 2012 13:34:21 +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>More About iPhone Development</title>
		<link>http://www.matthewsworkbench.com/more-iphone-development/</link>
		<comments>http://www.matthewsworkbench.com/more-iphone-development/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 01:04:35 +0000</pubDate>
		<dc:creator>Matthew Reed</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.matthewsworkbench.com/more-iphone-development/</guid>
		<description><![CDATA[I remain intrigued by the concept of iPhone program development. I think that the iPhone has the potential to make a real impact in the portable gaming market (Touch Arcade is a good source for information about iPhone gaming). Plus, I think that the iPhone is a neat little device and the only cell phone [...]]]></description>
			<content:encoded><![CDATA[<p>I remain intrigued by the concept of iPhone program development. I think that the iPhone has the potential to make a real impact in the portable gaming market (<a title="Touch Arcade: iPhone Games, Apps, News, and Reviews" href="http://toucharcade.com/">Touch Arcade</a> is a good source for information about iPhone gaming). Plus, I think that the iPhone is a neat little device and the only cell phone design that has ever appealed to me.</p>
<p>Apple has a page devoted to their <a href="http://developer.apple.com/iphone/program/">iPhone Developer Program</a>, but you still need to sign up before they will tell you any details. Some are complaining about the restrictions Apple has put on native programs written for the iPhone but they don&#8217;t sound that limiting to me. I imagine that the more severe ones, such as restrictions on private API&#8217;s and open source software, will be eased over time.</p>
<p>I had read before that Apple intended to ban emulators on the iPhone, but I can&#8217;t find any official confirmation of that. Apparently there&#8217;s no blanket ban, at least according to this: <a href="http://www.tuaw.com/2008/05/31/styletap-officially-bringing-palm-emulator-to-the-iphone-ipod/">StyleTap officially bringing Palm emulator to the iPhone / iPod touch</a>.</p>
</p>
<p>Of course, programming for the iPhone using Xcode isn&#8217;t really that different than using the Windows CE, Pocket PC, or Smartphone support built-in to Visual Studio. I&#8217;m sure that anyone who has ever used Visual Studio has created at least one &#8220;Hello world&#8221; program for the emulated smartphone. But has the Pocket PC ever excited as many people as the iPhone?</p>
<p>At this point, my interest in iPhone development remains just curiosity. A few problems remain:</p>
<ul>
<li>I don&#8217;t own a Macintosh (necessary to run Xcode and the iPhone emulator)
<li>I don&#8217;t own an iPhone (necessary to test programs)
<li>If I did own an iPhone, I would have travel around 100 miles to use it (according to the coverage maps)</li>
</ul>
<p>The first two problems could be remedied without too much trouble, but the third would be a bit more difficult.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsworkbench.com/more-iphone-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Developing for the iPhone</title>
		<link>http://www.matthewsworkbench.com/developing-for-the-iphone/</link>
		<comments>http://www.matthewsworkbench.com/developing-for-the-iphone/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 01:23:20 +0000</pubDate>
		<dc:creator>Matthew Reed</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.matthewsworkbench.com/developing-for-the-iphone/</guid>
		<description><![CDATA[I was intrigued by this article I saw at itWire: Write your own iPhone apps for fun and profit. Apparently, all it takes to program for the iPhone is to register as a developer with Apple and download the Apple iPhone Software Development Kit. Registration is free, and the SDK contains an iPhone emulator and [...]]]></description>
			<content:encoded><![CDATA[<p>I was intrigued by this article I saw at itWire: <a href="http://www.itwire.com/content/view/19336/1141/">Write your own iPhone apps for fun and profit</a>. Apparently, all it takes to program for the iPhone is to register as a developer with Apple and download the Apple iPhone Software Development Kit. Registration is free, and the SDK contains an iPhone emulator and all the necessary tools. The download itself is rather large, at over a gigabyte.</p>
<p>There seem to be two caveats:</p>
<ul>
<li>The SDK and tools run only on the Mac.
<li>You can test your programs on the emulator for free, but you need an Apple Developer program membership (which costs $99) if you want to run them on a real iPhone or sell them at the Apple iPhone Marketplace.</li>
</ul>
<p>Both seem to be pretty reasonable restrictions. It sounds as if it is pretty easy to experiment with iPhone development, which I&#8217;m sure is exactly what Apple wants.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsworkbench.com/developing-for-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protocol Buffers: An alternative to XML?</title>
		<link>http://www.matthewsworkbench.com/protocol-buffers/</link>
		<comments>http://www.matthewsworkbench.com/protocol-buffers/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 00:32:14 +0000</pubDate>
		<dc:creator>Matthew Reed</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.matthewsworkbench.com/protocol-buffers/</guid>
		<description><![CDATA[People have been buzzing lately with news of the announcement of Protocol Buffers: Google&#8217;s Data Interchange Format. BetaNews has a good overview: Google releases its data encoding format to compete with XML. Protocol Buffers are a flexible method for handling serialized data, generally for use with a database. Google has been using them internally for [...]]]></description>
			<content:encoded><![CDATA[<p>People have been buzzing lately with news of the announcement of <a title="Protocol Buffers: Google's Data Interchange Format" href="http://google-opensource.blogspot.com/2008/07/protocol-buffers-googles-data.html">Protocol Buffers: Google&#8217;s Data Interchange Format</a>. BetaNews has a good overview: <a title="Google releases its data encoding format to compete with XML" href="http://www.betanews.com/article/Google_releases_its_data_encoding_format_to_compete_with_XML/1215530589">Google releases its data encoding format to compete with XML</a>.</p>
<p>Protocol Buffers are a flexible method for handling serialized data, generally for use with a database. Google has been using them internally for some time, and has now made it available for all to use. You can examine the <a href="http://code.google.com/apis/protocolbuffers/docs/overview.html">documentation</a> and <a href="http://code.google.com/p/protobuf/downloads/">download</a> the package from Google.</p>
<p>The documentation is very detailed and is actually pretty interesting reading. It also shows that Protocol Buffers were created to fit a specific need within Google. I think that they are bound to appeal to anyone who has struggled with fitting XML into this particular type of application.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsworkbench.com/protocol-buffers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Literate Programming and Me</title>
		<link>http://www.matthewsworkbench.com/literate-programming-and-me/</link>
		<comments>http://www.matthewsworkbench.com/literate-programming-and-me/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 03:13:48 +0000</pubDate>
		<dc:creator>Matthew Reed</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.matthewsworkbench.com/literate-programming-and-me/</guid>
		<description><![CDATA[I recently began a new programming project. I&#8217;m writing these programs for my own use, so I have complete control over language and methodology. I&#8217;ve been intrigued by the concept of literate programming ever since I read Donald Knuth&#8217;s book titled Literate Programming. I thought that this would be a great opportunity to give literate [...]]]></description>
			<content:encoded><![CDATA[<p>I recently began a new programming project. I&#8217;m writing these programs for my own use, so I have complete control over language and methodology. I&#8217;ve been intrigued by the concept of literate programming ever since I read Donald Knuth&#8217;s book titled <a href="http://www.amazon.com/gp/product/0937073806?ie=UTF8&amp;tag=matreestrs80o-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0937073806">Literate Programming</a><img style="margin: 0px; border-top-style: none! important; border-right-style: none! important; border-left-style: none! important; border-bottom-style: none! important" height="1" alt="" src="http://www.assoc-amazon.com/e/ir?t=matreestrs80o-20&amp;l=as2&amp;o=1&amp;a=0937073806" width="1" border="0">. I thought that this would be a great opportunity to give literate programming a try.</p>
<p>The philosophy behind literate programming is that computer programs should be written for human readability, much like a work of literature. I&#8217;m using <a href="http://www-cs-faculty.stanford.edu/~knuth/cweb.html">CWEB</a>, a literate programming tool written by Donald Knuth and Silvio Levy. I create a source file that contains both documentation (written in TeX) and source code (written in C). The CWEB terminology is descriptive: you &#8220;tangle&#8221; to create C source files and &#8220;weave&#8221; to create TeX output.</p>
<p>I initially found it quite difficult to wrap my mind around the literate programming approach to writing. It took a while to find my &#8220;voice&#8221; and not just mimic ordinary commenting. I think I am finally getting the hang of it and I am beginning to see the benefits.</p>
<p>One of the things I like best about literate programming is that it lets me structure my program the way I want. I always like to block out program logic in broad terms and then fill in the details later. Using CWEB, I can actually write my programs in exactly that way. There is a great freedom in being able to place my code where I think it belongs rather than where the C compiler requires it to be.</p>
<p>I also like the mental discipline imposed by literate programming. That is more difficult to describe, but it is different than the ordinary planning that always goes into programming. Everyone knows that it is fairly easy to write code that looks correct but is fundamentally flawed. I find that design errors jump out at me when I try to describe my program in a narrative form.</p>
<p>One example illustrates my point. I was having a lot of trouble with one section of code even though it seemed pretty simple. I couldn&#8217;t figure out why I was having such problems with it until I spotted a design error. It was a fundamental mistake and I must have recognized that it was there on some level because I kept stumbling when I tried to describe the design. Remember that if I had written that code using non-literate techniques, <strong>the code would have looked correct</strong>. I only would have found the error later on. It took some extra time now, but literate programming saved me debugging time later on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsworkbench.com/literate-programming-and-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing FORTRAN in Any Language</title>
		<link>http://www.matthewsworkbench.com/writing-fortran-in-any-language/</link>
		<comments>http://www.matthewsworkbench.com/writing-fortran-in-any-language/#comments</comments>
		<pubDate>Tue, 13 May 2008 14:30:38 +0000</pubDate>
		<dc:creator>Matthew Reed</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Fortran]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.matthewsworkbench.com/writing-fortran-in-any-language/</guid>
		<description><![CDATA[If you&#8217;ve never heard the expression, it refers to the practice of carrying programming habits to a new context, even when they are inappropriate. Some programmers who began with FORTRAN continued to write programs that strongly resembled FORTRAN after they had moved to other languages. They remained too set in their ways and didn&#8217;t adapt [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve never heard the expression, it refers to the practice of carrying programming habits to a new context, even when they are inappropriate. Some programmers who began with FORTRAN continued to write programs that strongly resembled FORTRAN after they had moved to other languages. They remained too set in their ways and didn&#8217;t adapt their programming approach to a new way.</p>
<p>(I should point out that I always liked FORTRAN. Many of the failings people ascribe to FORTRAN-77 are related more to bad programming than the language itself. Also, Fortran-90 later addressed most of the actual weaknesses of FORTRAN-77.)</p>
<p>Jeff Atwood at <a title="Coding Horror" href="http://www.codinghorror.com/blog/">Coding Horror</a> wrote an interesting post called <a title="XML: The Angle Bracket Tax" href="http://www.codinghorror.com/blog/archives/001114.html">XML: The Angle Bracket Tax</a> concerning his dislike for the way XML is being used (or abused) by many programmers. He says:</p>
<p><span id="more-24"></span></p>
<blockquote><p>I realize that we have to use <i>something</i> to represent reasonably human readable data stored in a text file, but XML sometimes feels an awful lot like using an enormous sledgehammer to drive common household nails.</p>
</blockquote>
<p>I have found that when many people successfully solve a problem once, then they feel they must standardize on this solution and apply it to all future problems they encounter. Sometimes this makes sense, but much of the time it doesn&#8217;t. Each new problem should receive an appropriate solution, not the one that worked for different problems in the past.</p>
<p>I think that this describes the current problems with XML. If XML worked for you once, that doesn&#8217;t necessarily mean that you have to use it for everything you do in the future. Many times, programmers struggle against the complexities of XML when they would have had an easier time with a simpler format. They are only using a tiny subset of the features of XML, so why not just simplify their tasks by using a simpler format?</p>
<p>This isn&#8217;t to say that XML is useless. On the contrary, I think that it is incredibly important and will remain a dominant file format for years to come. I think that future-proofing your data is one of the best arguments for XML and one that is rarely mentioned. It is unlikely that XML will be forgotten anytime soon, which is something you can&#8217;t say for many other formats. Parsers will be available for all platforms for years to come. This is very important for data that must be archived and accessed in the future. But is future-proofing really that important for a simple initialization file?</p>
<p>Quite some time ago, I needed to examine a program that had been written in C++. This was not long after object-orientated programming had become a hot topic, and the author of that program had apparently decided to embrace everything object-oriented. In that code everything, and I mean everything, was an object. Not just things you would expect, such as lists, queues, or even strings (this predated the standard library). But absolutely everything, including simple operators, small portions of algorithms, even variables and constants! The sad part is, rather than promoting code reuse, the style actually meant that I doubt any part could have been used again.</p>
<p>I could have been convinced by that one bad example that C++ and all object-oriented languages were worthless and just a fad. But that program was not a good example of how to use C++, and did not reflect on the merits of C++ in the slightest way. The strange thing is that I don&#8217;t believe the author was a bad programmer, just overzealous in embracing C++&nbsp; (It might also have been intended to make a point, but that&#8217;s a whole other story).</p>
<p>No matter the programming tool or feature, there will always be a way to abuse it and you can be certain that someone will. You can write truly awful code in any language, and I can guarantee you that someone already has. But bad examples shouldn&#8217;t reflect on a tool or language, no matter how bad they are.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsworkbench.com/writing-fortran-in-any-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Games for the Browser</title>
		<link>http://www.matthewsworkbench.com/javascript-games-for-the-browser/</link>
		<comments>http://www.matthewsworkbench.com/javascript-games-for-the-browser/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 23:58:24 +0000</pubDate>
		<dc:creator>Matthew Reed</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://www.matthewsworkbench.com/programming/javascript-games-for-the-browser/</guid>
		<description><![CDATA[I was intrigued by this 14K JavaScript Super Mario Brothers demo. It requires no external image or sound files; everything it needs is included within the single 14K JavaScript file. I&#8217;ve seen many Flash-based and Java-based games (and even written a few), but I&#8217;ve never seen a JavaScript-only action game. But a quick search shows [...]]]></description>
			<content:encoded><![CDATA[<p>I was intrigued by this 14K JavaScript <a href="http://blog.nihilogic.dk/2008/04/super-mario-in-14kb-javascript.html">Super Mario Brothers demo</a>. It requires no external image or sound files; everything it needs is included within the single 14K JavaScript file. </p>
<p>I&#8217;ve seen many Flash-based and Java-based games (and even written a few), but I&#8217;ve never seen a JavaScript-only action game. But a quick search shows that there are many other examples. For instance, <a href="http://home.arcor.de/mschierlm/demoscene/breakout4k/">Breakout4K</a> is a 4K Breakout clone. Another example is <a href="http://www.3dtomb2.com/">3D TOMB 2</a>, a 4K DOOM-like game. None of these games are going to challenge the Xbox or the PlayStation, but I am always impressed by what is possible using limited resources.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsworkbench.com/javascript-games-for-the-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET Framework and Programming Languages</title>
		<link>http://www.matthewsworkbench.com/net-framework-and-programming-languages/</link>
		<comments>http://www.matthewsworkbench.com/net-framework-and-programming-languages/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 14:00:24 +0000</pubDate>
		<dc:creator>Matthew Reed</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.NET Framework]]></category>

		<guid isPermaLink="false">http://www.matthewsworkbench.com/programming/net-framework-and-programming-languages/</guid>
		<description><![CDATA[I like programming languages. I have used quite a number of them over the years, and I still use many different languages on a regular basis. A recent article in Infoworld suggests that programmers need to expand their language horizons. I agree, because I think that different types of problems lend themselves to different programming [...]]]></description>
			<content:encoded><![CDATA[<p>I like programming languages. I have used quite a number of them over the years, and I still use many different languages on a regular basis. A recent article in Infoworld <a href="http://www.infoworld.com/article/08/03/27/programmers-expand_1.html">suggests that programmers need to expand their language horizons</a>. I agree, because I think that different types of problems lend themselves to different programming languages.</p>
<p>I have been doing some programming recently with Microsoft&#8217;s .NET framework. For those who aren&#8217;t familiar with the .NET Framework, it is a complete departure from the Microsoft&#8217;s former WIN32 programming model.<span id="more-14"></span> Similar to Java in some ways, it is composed of two parts: the Base Class Library (BCL) and the Common Language Runtime (CLR). The Base Class Library is similar in concept to the C runtime library, only much larger in scope. The Common Language Runtime is an implementation of the Common Language Infrastructure (CLI) standard. It handles tasks such as memory management and exception handling and also runs bytecode called the Common Intermediate Language (CIL), formerly known as MSIL (Microsoft Intermediate Language). The bytecode is compiled using a just-in time (JIT) compiler. (This strikes me as far too many acronyms.) This is an simplified view of the whole architecture; there are many quirks and nuances involved, but this is the general idea.</p>
<p><span id="more-10"></span></p>
<p>The Common Library Runtime is actually a virtual machine, and the Common Intermediate Language is a type of assembly language for this virtual machine. The just-in-time compilation means that your code is compiled on the fly into your processor&#8217;s machine language. This means that anyone could (in theory) target a different processor just by writing a new just-in-time compiler to run your existing code. Currently, code does work without change on both 32-bit and 64-bit versions of Windows. </p>
<p>There are many programming languages available for the .NET Framework. Visual Studio comes with C#, Visual Basic .NET, and C++/CLI (which is a version of C++). You can download F# (a variant of ML) for free from Microsoft and F# will be an official Visual Studio language in the future. A quick search shows that other languages available for the .NET framework include Pascal, COBOL, APL, Lisp, Forth, Ada, Python, Prolog, Smalltalk, Haskell, Eiffel, and Ruby, among others. I&#8217;m sure that all of the versions of those languages are not equally usable, but they are available.</p>
<p>Because all of the .NET languages use the same Base Class Library, you can combine different programming languages in ways that weren&#8217;t possible before (at least in Windows). You can even use a decompiling utillity such as <a href="http://www.aisto.com/roeder/dotnet/">Reflector</a> to convert compiled programs from one language to another. Perhaps we are moving to a future when a programmer can pick the best programming language for a problem, instead of being limited to one or two choices.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsworkbench.com/net-framework-and-programming-languages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

