<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="http://www.kalekold.net/doesnotcompute.xml" rel="self" type="application/rss+xml" />
<title>Does Not Compute</title>
<link>http://www.kalekold.net/olderentries.php</link>
<description>Snippets And Observations On Software Development</description>
<lastBuildDate>Sun, 24 Jul 2011 12:05:52 +0000</lastBuildDate>
<language>en-us</language>
<copyright>Content copyright 2010 Gary Willoughby, All Rights Reserved. All source code is public domain and provided as is, so use at your own risk.</copyright>
<item>
<title>Implementing  Dynamic, Read-only Object Properties In PHP</title>
<link>http://www.kalekold.net/index.php?post=16</link>
<guid>http://www.kalekold.net/index.php?post=16</guid>
<pubDate>Mon, 13 Jun 2011 12:42:23 +0000</pubDate>
<description><![CDATA[<p><img class="imgright" src="http://img64.imageshack.us/img64/8786/readonlyw.jpg" border="0" alt="" />I was recently working on a PHP project where i needed (or would of liked) an object to have publicly available <a href="http://en.wikipedia.org/wiki/Property_(programming)" target="_blank">properties</a> which were read-only. Unfortunately PHP doesn't support this and the usual way of implementing something similar was to have private properties and standard <a href="http://en.wikipedia.org/wiki/Accessor" target="_blank">getter</a> methods. The trouble with getter methods is that sometimes they seem a little like overkill, especially if you're only accessing a name or an age, etc. Do you really need a method call to return a simple string or number that is always the same? Plus, in my opinion, they are harder to read than properties, although it could be argued only slightly.</p>

<p>But, take a look at these two lines of code:</p>

<code><br>$User-&gt;Name<br><br>$User-&gt;GetName();<br></code>

<p>To me the first one is much more meaningful and better reflects what it represents, not only that but if this is concatenated within another string the readability of its simplicity increases.</p>

<h2>Magic Methods</h2>
<p>So in order to simulate properties that are read-only i need to use some PHP kung fu called <a href="http://php.net/manual/en/language.oop5.magic.php" target="_blank">magic methods</a>.</p>

<p>So what are magic methods? Basically, they are special methods of a class that when defined are called when certain actions are performed on that class' <a href="http://en.wikipedia.org/wiki/Instance_(computer_science)" target="_blank">instantiated</a> object.<sup><a name="1" href="#note1">1</a></sup> One simple example would be, the <span class="inlinecode">&nbsp;__construct()&nbsp;</span> magic method which is called whenever a class is instantiated.<sup><a name="2" href="#note2">2</a></sup> There are 14 magic methods in total as of PHP v5.3 but the two i'll be mainly using here are <span class="inlinecode">&nbsp;__get()&nbsp;</span> and <span class="inlinecode">&nbsp;__set()&nbsp;</span>.</p>

<p>The <span class="inlinecode">&nbsp;__get()&nbsp;</span> method is called when you attempt to access a property of an object that is <strong>not</strong> accessible. It receives one parameter, the name of the property trying to be accessed and it returns one value, which will be treated as the value of that property.</p>

<p>The <span class="inlinecode">&nbsp;__set()&nbsp;</span> method is called when you attempt to change the value of an object property that is <strong>not</strong> accessible. It receives two parameters, the name of the property trying to be accessed and the new value of that property.</p>

<p>Okay, so lets see some code. First i'll show you a simple class that provides a little framework for working with read-only properties.</p>

<code><br>class ReadOnlyProperties {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;protected $Data;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public function __get($Property) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(array_key_exists($Property, $this-&gt;Data)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $this-&gt;Data[$Property];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;No property named '%s'.&quot;, $Property);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public function __set($Property, $Value) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(&quot;Properties are read-only.&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>}<br></code>

<p>Here i'm using an array called <span class="inlinecode">&nbsp;$Data&nbsp;</span> to hold the read-only properties instead of defining them in the class body. When code tries to access these properties and because they can't be found (in the class body) the <span class="inlinecode">&nbsp;__get()&nbsp;</span> and <span class="inlinecode">&nbsp;__set()&nbsp;</span> magic methods will trigger.</p>

<p>If you notice inside the <span class="inlinecode">&nbsp;__get()&nbsp;</span> method i'm using <span class="inlinecode">&nbsp;array_key_exists()&nbsp;</span> to test if the property trying to be accessed is actually within the <span class="inlinecode">&nbsp;$Data&nbsp;</span> array. If it is, return its value, if it's not, display an error.</p>

<p>Conversely, if code tries to set a property value (which is not accessible) the <span class="inlinecode">&nbsp;__set()&nbsp;</span> method is triggered and just shows an error. I show an error here because i want them all to be read-only.</p>

<p>To demonstrate, i'll create a simple class which inherits from the above class.</p>

<code><br>class User extends ReadOnlyProperties {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public function __construct($Name, $Age) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;Data[&quot;Name&quot;] = $Name;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;Data[&quot;Age&quot;] = $Age;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>}<br><br>$User = new User(&quot;Leeroy&quot;, 37);<br><br>echo $User-&gt;Name; //Displays 'Leeroy'<br><br>echo $User-&gt;Age; //Displays '37'<br><br>$User-&gt;Name = &quot;Jenkins&quot;; //Displays 'Properties are read-only.'<br><br>echo $User-&gt;Weight; //Displays 'No property named 'Weight'.'<br></code>

<p>Not bad eh? Because the code is trying to access properties that don't exist, i can re-route the request to the <span class="inlinecode">&nbsp;$Data&nbsp;</span> array using the magic methods, very neat indeed! But wait, there's more.</p>

<h2>Dynamic Property Loading</h2>
<p>Say for example you have a huge class that is composed of smaller classes and that each of the smaller classes need database or file access in their <a href="http://en.wikipedia.org/wiki/Constructor_(object-oriented_programming)" target="_blank">constructors</a> to initialise their objects properly. If you instantiated a huge object, all the little ones would usually be instantiated at the same time, accessing their individual resources whether you actually use them or not. What would be a better scenario is that you are able to instantiate a huge object and have each of the smaller ones instantiate themselves when actually accessed.</p>

<p>Using the above code as a starting point, i can add dynamically instantiating objects which initialise themselves when i actually access them as properties.</p>

<code><br>class User extends ReadOnlyProperties {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public function __construct($Name, $Age) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;Data[&quot;Name&quot;] = $Name;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;Data[&quot;Age&quot;] = $Age;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public function __get($Property) {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(array_key_exists($Property, $this-&gt;Data)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $this-&gt;Data[$Property];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else if ($Property == &quot;Address&quot;) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;Data[&quot;Address&quot;] = new Address($this-&gt;Name); //Read Database!<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $this-&gt;Data[&quot;Address&quot;];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;No property named '%s'.&quot;, $Property);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>}<br></code>

<p>Here i've overridden the <span class="inlinecode">&nbsp;__get()&nbsp;</span> magic method in the <span class="inlinecode">&nbsp;User&nbsp;</span> class with one that dynamically loads the <span class="inlinecode">&nbsp;Address&nbsp;</span> property when accessed for the first time. Subsequent access to the same property is from the <span class="inlinecode">&nbsp;$Data&nbsp;</span> array because <span class="inlinecode">&nbsp;array_key_exists()&nbsp;</span> returns true on account of the <span class="inlinecode">&nbsp;Address&nbsp;</span> property now exists in the <span class="inlinecode">&nbsp;$Data&nbsp;</span> Array. Awesome!</p>

<p>I'll stop now as this post is a lot longer than i anticipated but hopefully you can see that using PHP's magic methods you can open up new avenues in dynamic object behaviour. Take a look at the magic methods page in the PHP documentation and see how they could help in your next project.</p>

<p><a href="http://php.net/manual/en/language.oop5.magic.php" target="_blank">http://php.net/manual/en/language.oop5.magic.php</a></p>

<div id="notes">
<b>Notes</b>
<ol>
<li><a name="note1" href="#1">In fact there is one magic method which is used when trying to access inaccessible methods in a static context too.</a></li>
<li><a name="note2" href="#2">This is otherwise known as a constructor.</a></li>
</ol>
</div>

]]></description>
</item>
<item>
<title>IPhone Keypad: Where's The Decimal Point?</title>
<link>http://www.kalekold.net/index.php?post=15</link>
<guid>http://www.kalekold.net/index.php?post=15</guid>
<pubDate>Sun, 06 Feb 2011 23:23:10 +0000</pubDate>
<description><![CDATA[<p><img class="imgright" src="http://img198.imageshack.us/img198/7003/screenshot20110206at215.png" border="0" alt="" />While recently developing an <a href="http://www.kalekold.net/index.php?post=14" target="_blank">iPhone app</a> i needed a numeric keypad to appear to input a number. The only problem is that the built-in numeric keypad doesn't contain a decimal point, making entering floating point numbers impossible.</p>

<p>After reading the documentation there is however a few solutions.</p>

<ol>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Add a user created button to the standard numeric keypad.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Use the new <span class="inlinecode">&nbsp;UIKeyboardTypeDecimalPad&nbsp;</span> keypad type which was implemented in iOS v4.1</li>
</ol>

<p>I opted for number 2, both because it's easier to implement and because the decimal point functionality wasn't a critical feature for users of lesser iOS versions. The problem of the user not having iOS4.1 installed can be tested for before implementing the updated decimal keypad.</p>

<p>First of all the new <span class="inlinecode">&nbsp;UIKeyboardTypeDecimalPad&nbsp;</span> type is not available in <a href="http://en.wikipedia.org/wiki/Interface_Builder" target="_blank">Interface Builder</a> v3.2.5 (the latest version as of writing) making assigning this new type a little more difficult than selecting it from the drop-down menu. The screenshot above shows the only numeric keypad type available. I'm sure the next version of Interface Builder will have this new type available, but we can't wait until then. So lets get working with what we've got.</p>

<p>First, inside Interface Builder, drag a Text Field onto the View and bring up the Attribute Panel. In there, under the 'Text Input Traits' category select 'Number Pad' from the 'Keyboard' drop-down menu. This is the fallback keypad type in case the user is not using iOS 4.1+. Once that's done we need to modify the code in this view's controller.</p>

<p>In the view controller look for the <span class="inlinecode">&nbsp;- (void)viewDidLoad&nbsp;</span> method. This method is called when the view loads successfully and so it's where you should do any sort of initialisation.</p>

<p>Inside that method add this code:</p>

<code><br>if ((UIKeyboardTypeDecimalPad) &amp;&amp; ([[[UIDevice currentDevice] systemVersion] doubleValue] &gt;= 4.1)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;[self.TextField setKeyboardType:UIKeyboardTypeDecimalPad];<br>}<br></code>

<p>Here, we test that the <span class="inlinecode">&nbsp;UIKeyboardTypeDecimalPad&nbsp;</span> type is available that the <span class="inlinecode">&nbsp;systemVersion&nbsp;</span> is above or equal to 4.1. If these are both true we can assign the <span class="inlinecode">&nbsp;UIKeyboardTypeDecimalPad&nbsp;</span> type to our Text Field. Here is the result:</p>

<p><img class="imgleft" src="http://img31.imageshack.us/img31/7003/screenshot20110206at215.png" border="0" alt="" /></p>

<p><img class="imgleft" src="http://img600.imageshack.us/img600/7003/screenshot20110206at215.png" border="0" alt="" /></p>

<p>The left image shows the standard numeric keypad and the other image shows the decimal keypad if the user is running iOS 4.1 or greater.</p>

<p><div style="clear:both;">&nbsp;</div></p>]]></description>
</item>
<item>
<title>My First iPhone App</title>
<link>http://www.kalekold.net/index.php?post=14</link>
<guid>http://www.kalekold.net/index.php?post=14</guid>
<pubDate>Wed, 26 Jan 2011 00:04:32 +0000</pubDate>
<description><![CDATA[<p><a href="http://itunes.apple.com/app/repro-calc/id415368350?mt=8" target="_blank"><img class="imgright" src="http://img843.imageshack.us/img843/1641/screenshot20110125at225.png" border="0" alt="" /></a>Today, i have just witnessed a new milestone in my career as a software developer, that of seeing my first app accepted into the Apple <a href="http://en.wikipedia.org/wiki/App_Store" target="_blank">App Store</a>. It's a small uncomplicated app but from small acorns, mighty oaks grow!</p>

<p><a href="http://itunes.apple.com/app/repro-calc/id415368350?mt=8" target="_blank">Click here to see Repro Calc v1.0</a></p>

<p>Having learned <a href="http://www.kalekold.net/index.php?post=9" target="_blank">Objective-C</a> and familiarizing myself with the <a href="http://en.wikipedia.org/wiki/Xcode" target="_blank">XCode</a> developer tools over the last few months, i created a little app to familiarize myself with the process of design, development and distribution of iPhone software while conforming to Apple's strict standards. I can honestly say i've thoroughly enjoyed myself meeting this challenge and also feel as though i've learned a great deal about mobile programming in general!</p>

<h2>So what's the big deal?</h2>
<p>Well, i'm not a usual Apple <a href="http://www.iphonedownloadblog.com/2010/08/22/what-is-an-apple-fanboy/" target="_blank">fanboi</a> but recently i've recognised that Apple have been getting everything right. The integration of all their hardware and software with iTunes, the consistent user friendliness of all of their products, consistent attention to detail and high standards of, ...well, ...everything. Acknowledging this and being so impressed with my iPhone and iPad, i decided to start learning to write my own applications for my devices.</p>

<p>Learning Objective-C was a harder than i first thought because of it's very dynamic nature, lack of <a href="http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)" target="_blank">garbage collection</a> for iOS and learning to use the Xcode IDE was very puzzling. Puzzling because a lot of <a href="http://en.wikipedia.org/wiki/Boilerplate_(text)#Boilerplate_code" target="_blank">boilerplate</a> code is hidden from you and all code is written using <a href="http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller" target="_blank">MVC</a> and <a href="http://en.wikipedia.org/wiki/Delegation_pattern" target="_blank">Delegate</a> design patterns. This in itself is enough to put off most developers but believe me, it gets even more complicated.</p>

<h2>Developer validation</h2>
<p>Every developer that wants to develop <a href="http://en.wikipedia.org/wiki/IOS_(Apple)" target="_blank">iOS</a> applications, have to go through a ritual which certifies every step of the development process. Obviously this is controlled for consistency and high standards of craftsmanship but i understand when other developers scoff at the hoops you have to jump through to even test an app on your own device.</p>

<p>Here's the ritual:</p>

<ol>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Join Apple's developer program by paying £59 annual membership fee.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Authenticate and certificate your development environment and machine.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Record and authenticate your hardware devices. iPhone, iPad, etc.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Obtain a distribution certificate (free or commercial) for your app.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Install necessary distribution certificate into Xcode.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Test the app on your device.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Generate a distribution build from Xcode,  embedding the distribution certificate and compress the app.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Register your app with iTunes for distribution. (Fill in tax, bank and contact details, etc)</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Generate and record a unique ID for your app.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Grab screenshots and create a hires (512x512px) store logo.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Submit to Apple for approval.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Wait a week or so...</li>
</ol>

<p>Hardcore eh? and i'm sure i've <em>still</em> forgotten something!</p>

<p>It's that complicated that the Apple developer website has an interactive guide that holds your hand through the entire process. There's also a 180 page PDF you can download to read about the details of the entire process. So i'm feeling lots of satisfaction at the minute, not due to the coding challenge of using advanced design patterns with Objective-C but due to getting an app accepted by Apple after being subjected to one of the most intensive and complicated development and approval processes i have ever encountered.</p>

<h2>Conclusion?</h2>
<p>Simple! I loved every minute of the process and i'm starting a new app as we speak! Glutton for punishment? Probably, but the global iPhone app market is too temping to ignore.</p>

<p>It's tough, but give it a go. Learn something new. Learn how to do mobile programming right!</p>]]></description>
</item>
<item>
<title>Why You Should Use Revision Control</title>
<link>http://www.kalekold.net/index.php?post=13</link>
<guid>http://www.kalekold.net/index.php?post=13</guid>
<pubDate>Mon, 24 Jan 2011 22:15:19 +0000</pubDate>
<description><![CDATA[<p>Revision control is a little like insurance. You never see the value of it until you actually need it. Some programmers never touch it, while others swear by it. Revision control does contribute huge benefits while also introducing a small overhead on project management. I personally feel <em>every</em> project ever developed should always be placed under such a management system and here's why.</p>

<h2>First of all, what is revision control?</h2>
<p>Any revision control system is basically an enhanced database (called a repository) of a particular project's source code, which allows you to track authors, files and more importantly, changes. It allows an individual or a team to contribute to a project while giving the opportunity to review all changes against old versions and if necessary roll back a particular change.</p>

<p>This also enables the project to be easily 'branched' in order to provide a duplicate project that can be independently worked on (maybe to add an experimental feature) then later merged back into the main 'trunk' of the original project.</p>

<h2>Client/Server based revision control</h2>
<p>One type of revision control is server based where you have a central repository hosted on a local server or maybe located on the internet. This server houses all of the source code and developers 'check out' a file, change it and then commit the changes back to the repository, ensuring other developers can see and access the changes made.</p>

<p><img src="http://img696.imageshack.us/img696/8615/centralized.png" border="0" width="100%" alt="" /></p>

<p>Examples of such systems are:</p>

<ul>
&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="http://en.wikipedia.org/wiki/Concurrent_Versions_System" target="_blank">CVS</a></li>
&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="http://en.wikipedia.org/wiki/Perforce" target="_blank">Perforce</a></li>
&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="http://en.wikipedia.org/wiki/Apache_Subversion" target="_blank">Subversion</a> </li>
</ul>

<h2>Distributed revision control</h2>
<p>Revision control systems that have become popular recently are the ones which allow the repository to be decentralised, to allow all developers to have a local repository, to commit changes to and to keep updated. When this local repository has been updated with their changes, a change set can be forwarded to other people who have the same repository (or even a central server based repository) to update theirs to the new changes. This is called a distributed revision control system because it doesn't need to be hosted on a central server and is very much 'peer to peer'.</p>

<p><img src="http://img815.imageshack.us/img815/3559/distributedfull.png" border="0" width="100%" alt="" /></p>

<p>Examples of such systems are:</p>

<ul>
&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="http://en.wikipedia.org/wiki/Git_(software)" target="_blank">Git</a></li>
&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="http://en.wikipedia.org/wiki/Mercurial" target="_blank">Mercurial</a></li>
&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="http://en.wikipedia.org/wiki/Monotone_(software)" target="_blank">Monotone</a></li>
&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="http://en.wikipedia.org/wiki/Bazaar_(software)" target="_blank">Bazaar</a></li>
</ul>

<h2>So why use a revision control system?</h2>
<p>In my opinion, revision control is essential for doing anything even remotely professional either singularly or in a team. I don't mean using it will make your code any better but only that you will have full control over every aspect of every edit you make to your code base.</p>

<p>For example, what if you spent a few hours adding a new feature to a project, changing multiple files, only to discover that it didn't really work out and you want to roll back to an earlier state? Or maybe you notice a small bug that crept into a reliable module and wanted to check want changes were made in the last month? Even get a nice <a href="http://en.wikipedia.org/wiki/Diff" target="_blank">diff</a> to show the changes? Maybe you like to ship what you have now as version 1.0 and branch the project off to become version 2.0 adding more features, while still maintaining bug fixes for the previous unchanged version? The advantages are endless.</p>

<p>There really is no case for <em>not</em> using a revision control system. Using one, all edits are recorded and every change can be viewed or rolled back to a previous state. It's a god-like undo button that records the life and previous history of any file put under its control.</p>

<p>Download one now from the above lists and give it a try.</p>]]></description>
</item>
<item>
<title>Does Typing Speed Matter For Programmers?</title>
<link>http://www.kalekold.net/index.php?post=12</link>
<guid>http://www.kalekold.net/index.php?post=12</guid>
<pubDate>Sun, 26 Dec 2010 02:41:14 +0000</pubDate>
<description><![CDATA[<p>A few months ago <a href="http://en.wikipedia.org/wiki/Jeff_Atwood" target="_blank">Jeff Atwood</a> blogged again about the need for programmers to be good typists. In fact he has espoused sheer disdain over the years for all programmers if they were anything less than certified touch-typists. In <a href="http://www.codinghorror.com/blog/2008/11/we-are-typists-first-programmers-second.html" target="_blank">November 2008</a> he wrote</p>

<blockquote><img class="quoteleft" src="images/quoteleft.png" border="0" alt="" />We are typists first, and programmers second. It's very difficult for me to take another programmer seriously when I see them using the hunt and peck typing techniques.<img class="quoteright" src="images/quoteright.png" border="0" alt="" /></blockquote>

<p>Again, in <a href="http://www.codinghorror.com/blog/2010/10/the-keyboard-cult.html" target="_blank">October 2010</a> he continues</p>

<blockquote><img class="quoteleft" src="images/quoteleft.png" border="0" alt="" />I can't take slow typists seriously as programmers. When was the last time you saw a hunt-and-peck pianist?<img class="quoteright" src="images/quoteright.png" border="0" alt="" /></blockquote>

<p>Strong words indeed. Personally, i think he's missing the bigger issue. The whole reason we write code is to solve a problem in software. And in order to solve such problems there has to be a certain amount of thought expended on the problem in hand. If you look a little further down the page in the comments section of the 2010 entry he states</p>

<blockquote><img class="quoteleft" src="images/quoteleft.png" border="0" alt="" />I can type 150wpm+ on a keyboard...<img class="quoteright" src="images/quoteright.png" border="0" alt="" /></blockquote>

<p>Somehow, i doubt his claims because if this was the case he would be one of the fastest typists in the world.</p>

<blockquote><img class="quoteleft" src="images/quoteleft.png" border="0" alt="" />As of 2005, writer Barbara Blackburn was the fastest English language typist in the world, according to The Guinness Book of World Records. Using the Dvorak Simplified Keyboard, she has maintained 150 words per minute (wpm) for 50 minutes<img class="quoteright" src="images/quoteright.png" border="0" alt="" /><br />-- <strong>http://en.wikipedia.org/wiki/Typing#Words_per_minute</strong></blockquote>

<p>But, honestly is this really relevant? ...err... No!</p>

<h2>A Simple Test</h2>
<p>I've just taken a few typing tests on the internet to see how fast i type. The results were that i type at about 40-45 words per minute with a minimum amount of errors, so what does this mean? Well, using Jeff's premise the following is true</p>

<ol>
&nbsp;&nbsp;&nbsp;&nbsp;<li>Typing speed equates to being a good programmer.</li>
&nbsp;&nbsp;&nbsp;&nbsp;<li>I can solve software problems at the same rate as i type.</li>
</ol>

<p>So, my performance should be able to be graphed thus</p>

<code><br>HoursWorkedPerDay = 8;<br>MinutesPerHour = 60;<br>TypingSpeed = 40; //words per minute.<br>AverageWordsPerLine = 20;<br><br>LinesOfCode = HoursWorkedPerDay * MinutesPerHour * TypingSpeed / AverageWordsPerLine;<br><br>print(LinesOfCode); //960 lines of code.<br></code>

<p>If you work out Jeff's performance using the same formula you get about 3,500 lines of code a day!</p>

<p>But's there only one problem with this approach: <strong>It is nonsense!</strong> No programmer will ever be able to tell you how many lines of code he will be expected to write in a day because he has no idea what is going to be encountered, so why does Jeff insist that fast is good?</p>

<p><img class="imgleft" src="http://img26.imageshack.us/img26/7070/davidod.jpg" border="0" alt="" /></p>

<p>With creative endeavors, such as programming, there has to be time for contemplation for creativity to emerge, there has to be thought in what you are doing. No programmer has all the answers before starting to write code<sup><a name="1" href="#note1">1</a></sup> and problems tend to bloom as code is written as unforeseeable issues are dealt with.</p>

<p>Such is the case with sculpting any masterpiece as the image on the left hints at. <a href="http://en.wikipedia.org/wiki/David_(Michelangelo)" target="_blank">David</a> by <a href="http://en.wikipedia.org/wiki/Michelangelo" target="_blank">Michelangelo</a> took roughly 3 years to complete and no one measures Michelangelo's worth as a sculptor in 'stones chipped per day'. No one measures an architect's worth by the speed with which he draws a building plan. No one looks at a programmers code and measures the quality in the amount of code present or how fast it was typed.</p>

<p>So, when Jeff Atwood asks 'when was the last time you saw a hunt-and-peck pianist?' Well, never, because a pianist's job is to interpret static instructions and to play it at the correct speed, <em>not</em> necessarily to think about it. The composer, however, probably worked extremely hard creating and composing that piece and the quality of music produced was not measured on how fast the composer played the piano. I can pretty much guarantee that the composer worked on that piece far in excess of the time the piece of music plays for.</p>

<p>As long as you can type faster than you can solve software problems<sup><a name="2" href="#note2">2</a></sup>, you will be fine as a programmer. 40+ words per minute is adequate to make sure typing doesn't hinder your thoughts. Any programmer demanding that you are not as good as them because you can't type as fast is probably showing signs of <a href="http://en.wikipedia.org/wiki/elitism" target="_blank">elitism</a>.</p>

<blockquote><img class="quoteleft" src="images/quoteleft.png" border="0" alt="" />In one study of average computer users, the average rate for transcription was 33 words per minute, and only 19 words per minute for composition. In the same study, when the group was divided into 'fast', 'moderate' and 'slow' groups, the average speeds were 40wpm, 35wpm, and 23wpm respectively. 'Hunt and Peck' typists can reach speeds of about 37wpm for memorized text, and 27wpm when copying text. An average professional typist reaches 50 to 70wpm<img class="quoteright" src="images/quoteright.png" border="0" alt="" /><br />-- <strong>http://en.wikipedia.org/wiki/Typing#Alphanumeric_entry</strong></blockquote>

<div id="notes">
<b>Notes</b>
<ol>
<li><a name="note1" href="#1">No matter how much planning you do.</a></li>
<li><a name="note2" href="#2">Which is pretty much guaranteed as software problems can take a long time to find a solution.</a></li>
</ol>
</div>

]]></description>
</item>
<item>
<title>Does Branding Matter For Software?</title>
<link>http://www.kalekold.net/index.php?post=11</link>
<guid>http://www.kalekold.net/index.php?post=11</guid>
<pubDate>Thu, 25 Nov 2010 20:49:17 +0000</pubDate>
<description><![CDATA[<p><object width="100%" height="380"><param name="movie" value="http://blip.tv/play/AZPiFQI"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://blip.tv/play/AZPiFQI" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="100%" height="380"></embed></object></p>

<p>Steve Yegge presents his keynote: <em>How to Ignore Marketing and Become Irrelevant in Two Easy Steps.</em> From O'Reilly Media's Open Source Convention, July 26, 2007.</p>

<p>This is one of the best software talks i've seen<sup><a name="1" href="#note1">1</a></sup> which deals with the problem of software branding. Give it a watch and then ask yourself, does your software project need to worry about branding?</p>

<div id="notes">
<b>Notes</b>
<ol>
<li><a name="note1" href="#1">What makes it more awesome is the fact it's given without slides! (The machine broke down.)</a></li>
</ol>
</div>

]]></description>
</item>
<item>
<title>Stanford University iPhone Application Development Lectures</title>
<link>http://www.kalekold.net/index.php?post=10</link>
<guid>http://www.kalekold.net/index.php?post=10</guid>
<pubDate>Wed, 04 Aug 2010 21:11:26 +0000</pubDate>
<description><![CDATA[<p><img src="http://img145.imageshack.us/img145/3027/stanford.png" border="0" width="100%" alt="" /></p>

<h2>iPhone Development Training For Free</h2>
<p><a href="http://en.wikipedia.org/wiki/Stanford_University" target="_blank">Stanford University</a> have had a reputation of placing useful and free programming related resources online for a long time now. Personally, i have watched many of their computer science lectures online on <a href="http://www.youtube.com/user/stanforduniversity#p/p" target="_blank">YouTube</a> and learned a great deal while enjoying every minute.</p>

<p>I am extremely excited to learn that Stanford have now uploaded a complete suite of lectures to <a href="http://www.apple.com/itunes/" target="_blank">iTunes</a> focusing on programming using <a href="http://en.wikipedia.org/wiki/Objective-C" target="_blank">Objective-C</a> with the aim of creating apps for the iPhone. Very, very cool! Of course these lectures need a little background on Objective-C and <a href="http://en.wikipedia.org/wiki/Object-oriented_programming" target="_blank">OOP</a> in general and can be a little brief but if you have a grounding on Objective-C and OOP then you are in for a treat. Take a look for yourself and get learning.</p>

<p>These lectures have been released into the iTunes store free of charge so all you need to view these is iTunes installed.</p>

<p><a href="http://deimos3.apple.com/WebObjects/Core.woa/Browse/itunes.stanford.edu.3124430053.03124430055" target="_blank">Click here to launch iTunes and to view lectures</a></p>]]></description>
</item>
<item>
<title>Objective-C, A Language From Another Galaxy</title>
<link>http://www.kalekold.net/index.php?post=9</link>
<guid>http://www.kalekold.net/index.php?post=9</guid>
<pubDate>Tue, 03 Aug 2010 20:33:29 +0000</pubDate>
<description><![CDATA[<p><img src="http://img190.imageshack.us/img190/930/objectivec.png" border="0" width="100%" alt="" /></p>

<blockquote><img class="quoteleft" src="images/quoteleft.png" border="0" alt="" />Sir, I don't know where your ship learned to communicate, but it has the most peculiar dialect.<img class="quoteright" src="images/quoteright.png" border="0" alt="" /><br />-- <strong>C-3PO - Star Wars: Episode V - The Empire Strikes Back</strong></blockquote>

<p>Over the last few weeks i've been learning <a href="http://en.wikipedia.org/wiki/Objective-C" target="_blank">Objective-C</a>, <a href="http://www.apple.com" target="_blank">Apple's</a> flagship programming language, preferred for all <a href="http://en.wikipedia.org/wiki/Mac_OS" target="_blank">Mac OS</a> and <a href="http://en.wikipedia.org/wiki/IOS_%28Apple%29" target="_blank">iOS</a> development. Wanting to create my own iPhone and iPad apps, i wanted to learn Objective-C and of course after doing a great deal of programming using C type languages I thought it would be quite easy to learn and program using it, ...how wrong i was!</p>

<h2>A Galaxy Far, Far Away</h2>
<p>If you've ever programmed using C or C++ some things will be familiar but a lot will be very alien. Objective-C is a strict superset of ANSI C with the addition of <a href="http://en.wikipedia.org/wiki/Smalltalk" target="_blank">Smalltalk</a> style messaging designed to add <a href="http://en.wikipedia.org/wiki/Object-oriented_programming" target="_blank">OOP</a> features. Where as C++ and Java both have their origins in the <a href="http://en.wikipedia.org/wiki/Simula" target="_blank">Simula</a> language. If you're only used to Simula based languages Objective-C starts getting very weird very quickly.</p>

<blockquote><img class="quoteleft" src="images/quoteleft.png" border="0" alt="" />The Objective-C model of object-oriented programming is based on message passing to object instances. In Objective-C one does not call a method; one sends a message. This is unlike the Simula-style programming model used by C++. The difference between these two concepts is in how the code referenced by the method or message name is executed. In a Simula-style language, the method name is in most cases bound to a section of code in the target class by the compiler. In Smalltalk and Objective-C, the target of a message is resolved at runtime, with the receiving object itself interpreting the message. A method is identified by a selector which is a NULL-terminated string representing its name and which is resolved to a C method pointer implementing it. A consequence of this is that the message passing system has no type checking. The object to which the message is directed is not guaranteed to respond to a message, and if it does not, it simply raises an exception.<img class="quoteright" src="images/quoteright.png" border="0" alt="" /><br />-- <strong>http://en.wikipedia.org/wiki/Objective-C#Messages</strong></blockquote>

<h2>Do Or Do Not. There Is No Try</h2>
<p>Calling a method of an object pointed to by the pointer '*object' would require the following code in C++:</p>

<code>object-&gt;method(x, y);</code>

<p>In Objective-C, this is expressed as a message using square brackets:</p>

<code>[object method:x secondargname:y];</code>

<p>If you notice in the above code, after the first argument, each further argument is given a name when using it in a message. Very strange but actually quite informative and very useful.</p>

<p>Objective-C, like Smalltalk, can use dynamic typing, for example, an object can be sent a message that is not specified in its definition. This can allow for increased flexibility, as it allows an object to 'capture' a message and send it on to a different object which <em>can</em> respond to the message appropriately, or likewise send the message on to another object. This behavior is known as message forwarding or delegation. <sup><a name="1" href="#note1">1</a></sup> Alternatively, an error handler can be used in case the message cannot be forwarded. If an object does not forward a message, respond to it, or handle an error, the message is silently discarded.</p>

<h2>I Am Your Father</h2>
<p>Objective-C also has way of extending objects at runtime without inheriting from them or even needing access to the source code. These are called <a href="http://en.wikipedia.org/wiki/Objective-C#Categories" target="_blank">Categories</a> and can be added to any object. Categories are very similar to C#'s <a href="http://en.wikipedia.org/wiki/Extension_method" target="_blank">extension methods</a>. A category can collect method implementations into separate files if needed. A programmer can then place groups of related methods into a named category to make them more readable. For instance, one could create a spell checking category in the String object, collecting all of the methods related to spell checking into a single place. If a category declares a method with the same method signature as an existing method in a class, the category’s method is adopted.</p>

<h2>You Are A Protocol Droid Are You Not?</h2>
<p><a href="http://en.wikipedia.org/wiki/Objective-C#Protocols" target="_blank">Protocols</a> are very similar to interfaces in C# or Java but can be informal or formal. Put simply, an interface is a set of definitions of methods and values which the objects agree upon in order to cooperate. In Objective-C, informal protocols when declared in an object's definition don't have to be implemented, but can be in order to support optional messages, etc. Formal protocols when declared in an object's definition must be implemented by the object to provide a strict contract that other objects can rely on when using this object. Usually only formal protocols are available in other languages.</p>

<h2>The End</h2>
<p>I'm still learning Objective-C and i already like what i see. It's one of the weirdest languages i've ever used but i like C and the object stuff bolted on by Objective-C is the icing on the cake. Good programmers always advise you should occasionally try your hand with other languages and try something different once in a while to keep better informed and to get more experience. I'm loving learning Objective-C because it's so different from what i'm used to and there's so much new stuff to learn. I'm learning this language to eventually create my own iPhone and iPad apps, hopefully i'll keep you updated on what i discover while learning.</p>

<p>If you have the time and a sense of adventure, i'd strongly recommend you give Objective-C a go. You'll be confused for a while but who knows, you may enjoy learning something new and get some valuable experience along the way?</p>

<div id="notes">
<b>Notes</b>
<ol>
<li><a name="note1" href="#1">Which is another post in itself</a></li>
</ol>
</div>

]]></description>
</item>
<item>
<title>How to sort collections of custom types in C#</title>
<link>http://www.kalekold.net/index.php?post=8</link>
<guid>http://www.kalekold.net/index.php?post=8</guid>
<pubDate>Sat, 20 Mar 2010 14:05:19 +0000</pubDate>
<description><![CDATA[<p>I've recently created a program which sorts collections of custom types quite extensively and i thought i'd share the standard method of doing this. When i first started designing my program, i honestly thought it would be quite a pain sorting these collections but i was pleasantly surprised, as usual by the .NET framework, that there are built in shortcuts.</p>

<h2>IComparable&lt;T&gt;</h2>
<p>The first stage to allow a custom type to be sorted is to implement the IComparable&lt;T&gt; interface. <sup><a name="1" href="#note1">1</a></sup> This consists of one method: 'CompareTo(T)' where T is your custom type. This becomes your default comparer.</p>

<p>Here's an example: <sup><a name="2" href="#note2">2</a></sup></p>

<code><br>public class Person : IComparable&lt;Person&gt;<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;public Person(string Name, int Age, string Location)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Name = Name;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Age = Age;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Location = Location;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public string Name;<br>&nbsp;&nbsp;&nbsp;&nbsp;public int Age;<br>&nbsp;&nbsp;&nbsp;&nbsp;public string Location;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public int CompareTo(Person p)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return this.Name.CompareTo(p.Name);<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public override string ToString()<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return string.Format(&quot;{0} is {1} years old and lives in {2}&quot;, this.Name, this.Age, this.Location);<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br></code>

<p>Once that method is implemented (here we've implemented it using the name field to compare against) you can use the native sort methods on a collection of such types and have them sorted via this default comparer. For example if you are using an array as your collection, you can use the default static 'Sort' method to sort it:</p>

<code><br>Person[] People = new Person[2];<br><br>People[0] = new Person(&quot;Jane Seymore&quot;, 25, &quot;Lincoln&quot;);<br>People[1] = new Person(&quot;Gary Willoughby&quot;, 36, &quot;Lincoln&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>Array.Sort(People);<br></code>

<p>If you are using a generic list you can use the built in 'Sort' method:</p>

<code><br>List&lt;Person&gt; People = new List&lt;Person&gt;();<br><br>People.Add(new Person(&quot;Jane Seymore&quot;, 25, &quot;Lincoln&quot;));<br>People.Add(new Person(&quot;Gary Willoughby&quot;, 36, &quot;Lincoln&quot;));<br><br>People.Sort();<br></code>

<p>Again this uses the default comparer and sorts the collection by the name field.</p>

<h2>Comparison&lt;T&gt;</h2>
<p>If you need to give the user the option of multiple ways of sorting your collection you must implement other comparers. This is achieved by implementing Comparison&lt;T&gt; delegates. Let's implement some in our custom type to allow sorting of every field:</p>

<code><br>public class Person : IComparable&lt;Person&gt;<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;public Person(string Name, int Age, string Location)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Name = Name;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Age = Age;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Location = Location;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public string Name;<br>&nbsp;&nbsp;&nbsp;&nbsp;public int Age;<br>&nbsp;&nbsp;&nbsp;&nbsp;public string Location;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public int CompareTo(Person p)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return this.Name.CompareTo(p.Name);<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public static Comparison&lt;Person&gt; SortByName = delegate(Person p1, Person p2)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return p1.Name.CompareTo(p2.Name);<br>&nbsp;&nbsp;&nbsp;&nbsp;};<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public static Comparison&lt;Person&gt; SortByAge = delegate(Person p1, Person p2)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return p1.Age.CompareTo(p2.Age);<br>&nbsp;&nbsp;&nbsp;&nbsp;};<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public static Comparison&lt;Person&gt; SortByLocation = delegate(Person p1, Person p2)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return p1.Location.CompareTo(p2.Location);<br>&nbsp;&nbsp;&nbsp;&nbsp;};<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public override string ToString()<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return string.Format(&quot;{0} is {1} years old and lives in {2}&quot;, this.Name, this.Age, this.Location);<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br></code>

<p>Here, as well as the default comparer, we have implemented three Comparison&lt;T&gt; delegates to provide the rules of sorting the three fields in the custom type. They have been made static so you can use them without referring to an instance of the custom type.</p>

<p>Here is an example of sorting an array of our custom type by the Age field.</p>

<code><br>Array.Sort(People, Person.SortByAge);<br></code>

<p>and here is how you sort a generic list collection by the Age field:</p>

<code><br>People.Sort(Person.SortByAge);<br></code>

<p>Simple.</p>

<p>Hopefully this gives you good grounding on sorting custom type collections and although there are other ways of sorting available in the .NET framework, these are the most common.</p>

<div id="notes">
<b>Notes</b>
<ol>
<li><a name="note1" href="#1">There is also a non generic version of this interface but i prefer this one, otherwise you are continually casting and unboxing in your comparers.</a></li>
<li><a name="note2" href="#2">I'm using standard public string fields in this type for the sake of brevity. If this was a real type in a real program then you would probably substitute these fields for properties with explicit get and set property methods.</a></li>
</ol>
</div>

]]></description>
</item>
<item>
<title>How do I love thee? Let me count the ways...</title>
<link>http://www.kalekold.net/index.php?post=7</link>
<guid>http://www.kalekold.net/index.php?post=7</guid>
<pubDate>Wed, 17 Mar 2010 21:43:53 +0000</pubDate>
<description><![CDATA[<blockquote><img class="quoteleft" src="images/quoteleft.png" border="0" alt="" />How do I love thee? Let me count the ways.
I love thee to the depth and breadth and height
My soul can reach, when feeling out of sight
For the ends of Being and ideal Grace.
I love thee to the level of every day's
Most quiet need, by sun and candle-light.
I love thee freely, as men strive for Right;
I love thee purely, as they turn from Praise.
I love thee with a passion put to use
In my old griefs, and with my childhood's faith.
I love thee with a love I seemed to lose
With my lost saints, I love thee with the breath,
Smiles, tears, of all my life! and, if God choose,
I shall but love thee better after death.<img class="quoteright" src="images/quoteright.png" border="0" alt="" /><br />-- <strong>Elizabeth Barrett Browning</strong></blockquote>

<p>What is it about programming? What is that thing that keeps me coming back for more? Why do i spend countless lonely hours tapping away at my keyboard into the small hours of the morning?</p>

<p>One word: Creativity!</p>

<p>I love programming! I absolutely love the solving of problems and the technical challenge of putting thought into code. I love the whole process of dreaming up architecture to elegantly deal with the problem at hand. I love the minutiae of GUI design and the ordering of chaos when a program is correctly structured. Code is art, in fact i consider it a craft. A craft that you have to pour your mind into (body and soul are usually not required), something you can sculpt and carve until it meets your requirements. Something you have to personally take charge off and reign in until it does your bidding. Most of all, it's something you do lovingly.</p>

<p>As you can guess, i'm in love with programming in any language.<sup><a name="1" href="#note1">1</a></sup> This is mainly because i'm a very creative person and i feel lost if i'm not working on a project of some sort. I feel there is always something trying to escape from me, something creative that i need to share with the world, something that people will use and enjoy.</p>

<p>I need to create 'stuff' and in today's world, that 'stuff' is software!</p>

<p>It wasn't always the case though. I have worked full time as a graphic artist since leaving school so i have always been creative in one form or another but programming is something i got into as soon as i wrote my first <a href="http://en.wikipedia.org/wiki/Hello_world_program" target="_blank">Hello World</a> program over ten years ago. This is the piece if code responsible:</p>

<code><br>&lt;html&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;head&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;Hello, World&lt;/title&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/head&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;body&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script type=&quot;text/javascript&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.write(&quot;Hello, World&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/script&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/body&gt;<br>&lt;/html&gt;<br></code>

<p>Not very impressive but a catalyst in recruiting me to the ranks of developers throughout the world. A simple example of dictating to a computer what to do and an example of individualism, stamping my authority on the silicon chip i made do my bidding!</p>

<p>Not only do i love programming but i love delivering the finished product. The overriding feeling of satisfaction when completing a project is immense and seeing people use and enjoy your software is awesome compensation for the long hours spent. Something you have created and given (or sold) to a user that makes his or her life easier is part of the payoff that exists in such a craft. As if you had created a comfy chair for someone who needed a well earned rest. It's awesome to fill those needs for people and to feel you have done a good job.</p>

<p>Another appealing aspect for me is the fact that you will never finish learning about programming. They're are just too many languages, too many platforms and too many <a href="http://en.wikipedia.org/wiki/Paradigm_%28computer_science%29" target="_blank">paradigms</a>. It's a never ending intellectual adventure, a fun puzzle that can never be wholly solved, something to be poured over and studied from now until eternity. ...Ah, pure bliss!</p>

<p>A long winded and strange post i know, but i just felt this uncontrollable urge to express myself!</p>

<div id="notes">
<b>Notes</b>
<ol>
<li><a name="note1" href="#1">Apart from those weird functional languages, but i'll save that for another post!</a></li>
</ol>
</div>

]]></description>
</item>
</channel>
</rss>

