<?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>Perspx &#187; Programmers</title>
	<atom:link href="http://perspx.com/blog/archives/category/programmers/feed/" rel="self" type="application/rss+xml" />
	<link>http://perspx.com</link>
	<description>Musings of a teenage programmer</description>
	<lastBuildDate>Thu, 20 May 2010 06:56:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Reinventing the wheel</title>
		<link>http://perspx.com/blog/archives/606/reinventing-the-wheel/</link>
		<comments>http://perspx.com/blog/archives/606/reinventing-the-wheel/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 18:50:46 +0000</pubDate>
		<dc:creator>Perspx</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programmers]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://oneinfinitemonkey.wordpress.com/?p=606</guid>
		<description><![CDATA[Reinventing the wheel – a phrase which means duplicating an existing feature from scratch – is often used in the context that it is unnecessary or inefficient.
I think that in most cases this is true, but I was hesitant to start this post by screaming to never, ever, under any circumstances whatsoever reinvent the wheel, because I think that sometimes  ... ]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://jeffreyhill.typepad.com/.a/6a00d8341d417153ef01156fb3f348970c-800wi" target="_blank"><img class="alignright size-full wp-image-877" title="Reinventing the wheel" src="http://perspx.com/wp-content/uploads/2009/11/reinventwheel1.jpg" alt="" width="251" height="298" /></a>Reinventing the wheel</strong> – a phrase which means duplicating an existing feature from scratch – is often used in the context that it is unnecessary or inefficient.</p>
<p>I think that in most cases this is true, but I was hesitant to start this post by screaming to never, ever, under any circumstances <em>whatsoever </em>reinvent the wheel, because I think that sometimes it <em>can</em> be necessary or at least justified.</p>
<p>I <a href="http://oneinfinitemonkey.wordpress.com/2009/11/06/programmers-love-to-make-their-lives-difficult/" target="_blank">wrote last week</a> about programmers who make their lives difficult for themselves by doing things the &#8220;wrong&#8221; way, essentially due to their ignorance or inexperience with whatever they&#8217;re doing. For this class of programmers, the saying &#8220;Don&#8217;t reinvent the wheel&#8221; <em>probably</em> sticks.</p>
<p>But there are some situations where it can be beneficial to reinvent the wheel, <strong>so long as you know why you&#8217;re doing it</strong> and it&#8217;s <strong>for the right reasons</strong>:</p>
<ol>
<li><strong>The current options out there don&#8217;t suit your needs</strong>. Sometimes you want to re-implement something that is already out there, because it doesn&#8217;t do what you want to do, which compromises some core functionality of what you want to achieve. By implementing this yourself it will make your software better in some way and will be a <strong>worthwhile</strong> use of your time.</li>
<li><strong>You want a lighter version of what&#8217;s already out there</strong>. You feel that the options out there are too bloated for what you want (often because they are generic) so rolling your own is a way of making your software more efficient. Stack Overflow user Ólafur Waage actually did this with his blog, <a href="http://cznp.com/blog" target="_blank">Cyborg Zombie Ninja Pirate</a> (CZNP) which he <a href="http://cznp.com/blog/1/developing-a-blog" target="_blank">explained and justified</a> in his first post:<br />
<blockquote><p>I am sick and tired of large bloated CMS or blog systems. Wordpress I&#8217;m looking at you.</p>
<p>I&#8217;ve been a fan of the idea that people who are smarter than you should do their smart work for you. And I tried my best to apply that to the current blogging systems out there. So I said enough is enough. I&#8217;ll make my own.</p></blockquote>
<p>Which is something (ironically) I agree with. By doing so it meant that he had a more efficient and more favourable option than what was already out there.</li>
<li><strong>As a </strong><strong>learning experience</strong>. Although not perhaps for use in actual products, sometimes I will implement something that is readily available in order to learn from it, perhaps for a side-project or something which isn&#8217;t constrained by time or resources. Although it often won&#8217;t make my life easier, it will help broaden my knowledge on a particular area, which I think is an important supplement to software development.</li>
</ol>
<p>It&#8217;s very easy to feel the need to re-implement something that&#8217;s already out there, but make sure that if you do it&#8217;s for the right reasons and the end result will have made your extra efforts worthwhile.</p>
]]></content:encoded>
			<wfw:commentRss>http://perspx.com/blog/archives/606/reinventing-the-wheel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Programmers love to make their lives difficult</title>
		<link>http://perspx.com/blog/archives/597/programmers-love-to-make-their-lives-difficult/</link>
		<comments>http://perspx.com/blog/archives/597/programmers-love-to-make-their-lives-difficult/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 19:17:15 +0000</pubDate>
		<dc:creator>Perspx</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programmers]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://oneinfinitemonkey.wordpress.com/?p=597</guid>
		<description><![CDATA[When starting out with Mac development, I turned to Aaron Hillegass&#8217;s Cocoa Programming for Mac OS X, and compared to other books available on the subject I was very pleased with it. One point that he made in the opening chapter has pretty much remained true whilst I&#8217;ve been developing under OS X with the Cocoa frameworks:
Most of the time,  ... ]]></description>
			<content:encoded><![CDATA[<p>When starting out with Mac development, I turned to Aaron Hillegass&#8217;s <em><a href="http://www.amazon.co.uk/Cocoa-Programming-Mac-OS-X/dp/0321503619/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1234335189&amp;sr=1-1" target="_blank">Cocoa Programming for Mac OS X</a></em>, and compared to other books available on the subject I was very pleased with it. One point that he made in the opening chapter has pretty much remained true whilst I&#8217;ve been developing under OS X with the Cocoa frameworks:</p>
<blockquote><p>Most of the time, Cocoa fulfills the promise: Common things are easy, and uncommon things are possible. <strong>If you find yourself writing many lines of code to do something rather ordinary, you are probably on the wrong track</strong>.</p></blockquote>
<p>And I don&#8217;t think that this is unique to development with Cocoa – a lot of libraries these days promote ease-of-use for the developer.</p>
<p>However, it seems that a lot of programmers <strong><em>love</em> to make their lives more difficult</strong>, by not thinking about what they&#8217;re doing to solve a problem, and go in blind to find something that <strong>works</strong> – perhaps as trial and error because they are not familiar with the area they are developing for  – but which makes more work in the long-run by being harder to maintain.</p>
<p>The other day I was browsing the website of European cinema chain <a href="http://www.odeon.co.uk/" target="_blank">Odeon</a> to look up times for a film. I was appalled to see that the &#8220;Book Now&#8221; form in the right-hand column of the page was implemented using Flash.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-875" title="Odeon &quot;book now&quot; form" src="http://perspx.com/wp-content/uploads/2009/11/odeon1.jpg" alt="" width="239" height="279" /></p>
<p>I wondered what on <em>Earth</em> was going through the developer&#8217;s mind when he (or she, but I&#8217;ll keep it simple) decided to implement a bog-standard HTML form by going for something Flash-based. All the features of the form could be easily implemented in HTML and Javascript (there were no fancy effects) – and if the argument there was along the lines of &#8220;Yes, but what if Javascript is turned off?&#8221; then surely Flash would be a no-go too?</p>
<p>What made it even more annoying was that <strong>in his haste to make his life more difficult</strong>, he forgot to implement scrolling of the combo box options using the mouse wheel, which when I went to scroll the list caused scrolling of the page instead. So, basically, what the developer has done here is:</p>
<ul>
<li>Provided a less than adequate visual appearance (at least compared to what would otherwise be there with an HTML form) which doesn&#8217;t look like a &#8220;native&#8221; combo box.</li>
<li>Implemented different behaviour than would otherwise be implemented if using an HTML form, thus causing confusion and annoyance.</li>
<li>Re-implemented something that could be done easily in HTML, <strong>with about 3 times as much effort</strong>.</li>
</ul>
<p>If he had just stuck to HTML, CSS and Javascript then there would be a cleaner experience for the user, and one less dependency in the project. It just seems like such a redundant decision.</p>
<p>I often talk about this when people ask about subclassing in Objective-C/Cocoa for the Mac or iPhone. Unlike some other libraries, the Cocoa frameworks promote extension through interaction with the classes, rather than subclassing them, which is often a last-resort. In <a href="http://stackoverflow.com/questions/992389/subclassing-nsoutlineview/992455#992455" target="_blank">giving such advice</a>, I often start with something like this:</p>
<blockquote><p>Firstly, before you subclass an object, you should ask yourself &#8220;do I <em>need</em> to do this?&#8221;</p></blockquote>
<p>The general idea here is that <strong>people will often go out of their way to make life harder for themselves</strong>, in order to change some functionality of a class that could otherwise be done through interaction with the class in one line of code, simply because they do not know of a simpler way, or do not dedicate a bit of their time to find out a more efficient method.</p>
<p>I think that a key skill in any programmer&#8217;s life is when you develop a certain intuition for what seems to be right or wrong –  you come up with a solution to your problem which looks too verbose or complex for what you&#8217;re trying to achieve, and this sets alarm bells ringing. However, before this is the case (and even when you do develop this skill), it&#8217;s important to think about what you&#8217;re doing; if you are approaching the problem, do some light research into it and ensure that what you are doing is one of the best, most efficient and painless ways to do it.</p>
<p>Make sure that what you&#8217;re <strong>doing is for the right reasons</strong>, and not simply doing it to make it work.</p>
]]></content:encoded>
			<wfw:commentRss>http://perspx.com/blog/archives/597/programmers-love-to-make-their-lives-difficult/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
