<?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>Cocoa Is My Girlfriend &#187; Rants</title>
	<atom:link href="http://www.cimgf.com/category/rants/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cimgf.com</link>
	<description>Taglines are for Windows programmers</description>
	<lastBuildDate>Thu, 15 Jul 2010 21:20:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Getting &#8220;Real Work&#8221; Done</title>
		<link>http://www.cimgf.com/2010/01/30/getting-real-work-done/</link>
		<comments>http://www.cimgf.com/2010/01/30/getting-real-work-done/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 21:02:50 +0000</pubDate>
		<dc:creator>Matt Long</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.cimgf.com/?p=899</guid>
		<description><![CDATA[I had to post a link to this one as well as Fraser does such a great job explaining why the iPad is so compelling . From Fraser&#8217;s post: The tech industry will be in paroxysms of future shock for some time to come. Many will cling to their January-26th notions of what it takes [...]]]></description>
			<content:encoded><![CDATA[<p>I had to post a <a href="http://speirs.org/blog/2010/1/29/future-shock.html">link to this one as well</a> as Fraser does such a great job explaining why the iPad is so compelling . From Fraser&#8217;s post:</p>

<blockquote>The tech industry will be in paroxysms of future shock for some time to come. Many will cling to their January-26th notions of what it takes to get &#8220;real work&#8221; done; cling to the idea that the computer-based part of it is the &#8220;real work.&#8221;
<br /><br />
It&#8217;s not. The Real Work is not formatting the margins, installing the printer driver, uploading the document, finishing the PowerPoint slides, running the software update or reinstalling the OS.
<br /><br />
<strong>The Real Work is teaching the child, healing the patient, selling the house, logging the road defects, fixing the car at the roadside, capturing the table&#8217;s order, designing the house and organizing the party.</strong>
</blockquote>

<p>Exactly! The iPad is genius and it will revolutionize not just books, magazines, etc., but it will revolutionize computing as we know it. I don&#8217;t know about you, but I&#8217;ve got the new SDK fired up and ready to start rocking some apps and it is a very exciting new platform!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cimgf.com/2010/01/30/getting-real-work-done/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why version control is important for solo developers</title>
		<link>http://www.cimgf.com/2009/11/07/why-version-control-is-important-for-solo-developers/</link>
		<comments>http://www.cimgf.com/2009/11/07/why-version-control-is-important-for-solo-developers/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 15:22:28 +0000</pubDate>
		<dc:creator>Fraser Hess</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[microISV]]></category>

		<guid isPermaLink="false">http://www.cimgf.com/?p=786</guid>
		<description><![CDATA[It&#8217;s common practice for any software project with multiple coders to use some version control mechanism. CVS or Subversion used to be popular. These days distributed systems like git and Mercurial are the quickly replacing the old standards. But what about the cases when you&#8217;re the only coder? Let me tell you. Whatever the initial [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s common practice for any software project with multiple coders to use some version control mechanism. CVS or Subversion used to be popular. These days distributed systems like git and Mercurial are the quickly replacing the old standards. But what about the cases when you&#8217;re the only coder?
<span id="more-786"></span>
Let me tell you.  Whatever the initial setup cost, coding is much easier with version control than without it.</p>

<p>Firstly, if you think that you only work with yourself and you can handle yourself, have a quick look at the <strong>I Am A Moron</strong> section of <a href="http://www.cimgf.com/2009/03/26/dont-blindly-trust-debb/">this post</a> or <a href="http://twitter.com/kevinhoctor/status/5376014212">this recent tweet</a> by Kevin Hoctor.</p>

<p>Now a few years ago, I started work on a helpdesk ticketing system called tina. In the early days of tina development, I&#8217;d didn&#8217;t use any version control. I was frequently confused by my own code. I&#8217;d look at a piece of code and wonder, &#8220;What was I trying to do here?&#8221; or &#8220;When did I change this? Wait, did I change this?&#8221;. Occasionally, I&#8217;d tar-up my code for a historical record and I&#8217;m not sure now if I ever referred to those tarballs. When I eventually put the tina code into a Subversion repository I was much happier because of it.</p>

<p>With another project, that I wanted to put under version control, I found I had no less that 3 different versions of the code lying around on my hard drive. It look some investigation with <code>diff</code> in order to find out which one was the most current. Fortunately I didn&#8217;t have some files more recent in one copy and others more recent in another copy, but that could have easily happened.</p>

<p>With version control, it&#8217;s easy to find out what changed in my code, especially if I write useful commit messages. The most unexpected (and incredibly positive) side effect was that once I started using version control, the quality of my code went up dramatically. By tracking exactly what was changing between revisions, unwanted changes and debug code did not slip into the shipping code.</p>

<p>It&#8217;s worth noting that this approach goes hand-in-hand with unit testing.  Version control lets you know what is changing and unit testing lets you know that your changes don&#8217;t result in regressions.  As solo developers without QA teams or even a QA person, using these best practices seriously improves our ability to complete with larger organizations.</p>

<p>So, I recommend version control for any coding project bigger than a few lines of code. I used Subversion for a while and have now moved onto git.</p>

<p>My tips for version control success:</p>

<ul>
<li><strong>Make small commits</strong> &#8211; don&#8217;t commit a whole day&#8217;s work if you wrote 2 features and fixed 8 bugs. That should be at least 10 commits. For sure, commit every-time you complete something &#8211; a bugfix, a feature, fixing a typo, a formatting change. It&#8217;s makes it much easier to find regressions and other issues later. Oh, and try not to work on many things at once especially if the changes overlap in the code.
<li><strong>Compile before commit</strong> &#8211; each commit represents a known state of your code, so make sure the code compiles correctly without warnings or errors before committing.
<li><strong>Diff before commit</strong> &#8211; before each commit, look over the diff of your current code compared with the last commit.  Then you&#8217;ll know for sure what you are committing. If you don&#8217;t like part of the proposed commit, change it, diff it again, repeat until you like it and then commit.
<li><strong>Write useful messages</strong> &#8211; When you commit a message is required is usually. Make sure it makes sense to you and to others looking at your repository.
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.cimgf.com/2009/11/07/why-version-control-is-important-for-solo-developers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The journey to disabling sleep with IOKit</title>
		<link>http://www.cimgf.com/2009/10/14/the-journey-to-disabling-sleep-with-iokit/</link>
		<comments>http://www.cimgf.com/2009/10/14/the-journey-to-disabling-sleep-with-iokit/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 18:30:42 +0000</pubDate>
		<dc:creator>Fraser Hess</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Undocumented]]></category>

		<guid isPermaLink="false">http://www.cimgf.com/?p=760</guid>
		<description><![CDATA[If your app is fullscreen, like a game, has a presentation mode, or plays long running movie files, you&#8217;ll want to disable the display from sleeping. DVD Player and Keynote are perhaps the two most obvious examples of this functionality. The documentation for this is a little spotty so here&#8217;s the results of my investigation. [...]]]></description>
			<content:encoded><![CDATA[<p>If your app is fullscreen, like a game, has a presentation mode, or plays long running movie files, you&#8217;ll want to disable the display from sleeping.  DVD Player and Keynote are perhaps the two most obvious examples of this functionality.
<span id="more-760"></span>
The documentation for this is a little spotty so here&#8217;s the results of my investigation.  My initial googling found this snippet from <a href="http://developer.apple.com/mac/library/qa/qa2004/qa1160.html">here</a>.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;">UpdateSystemActivity<span style="color: #002200;">&#40;</span>OverallAct<span style="color: #002200;">&#41;</span>;</pre></td></tr></table></div>


<p>The docs explain that you fire this every 30 seconds.  On the surface, this looks like a hack and well, I don&#8217;t need a Carbon C call for that, I can fake a mouse event every 30 seconds.</p>

<p>This is out for good anyway, given that it doesn&#8217;t compile on Snow Leopard on x86_64. Carbon 64-bit will never arrive.</p>

<p>Turns out that the modern way to disable sleep uses IOKit. Apple has <a href="http://developer.apple.com/mac/library/qa/qa2004/qa1340.html">a doc</a> for that too. Here is Listing 2:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &lt;IOKit/pwr_mgt/IOPMLib.h&gt;</span>
&nbsp;
...
<span style="color: #11740a; font-style: italic;">// kIOPMAssertionTypeNoDisplaySleep prevents display sleep,</span>
<span style="color: #11740a; font-style: italic;">// kIOPMAssertionTypeNoIdleSleep prevents idle sleep</span>
&nbsp;
IOPMAssertionID assertionID;
IOReturn success <span style="color: #002200;">=</span> IOPMAssertionCreate<span style="color: #002200;">&#40;</span>kIOPMAssertionTypeNoDisplaySleep, 
                                    kIOPMAssertionLevelOn, <span style="color: #002200;">&amp;</span>assertionID<span style="color: #002200;">&#41;</span>; 
<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>success <span style="color: #002200;">==</span> kIOReturnSuccess<span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">//Add the work you need to do without </span>
    <span style="color: #11740a; font-style: italic;">//  the system sleeping here.</span>
&nbsp;
    success <span style="color: #002200;">=</span> IOPMAssertionRelease<span style="color: #002200;">&#40;</span>assertionID<span style="color: #002200;">&#41;</span>;
    <span style="color: #11740a; font-style: italic;">//The system will be able to sleep again. </span>
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>


<p>With any sample code that I&#8217;m gonna try to use in my apps, I take the time to understand what&#8217;s going on, and to read the docs for that with which I&#8217;m not familiar.  (Don&#8217;t you?  That&#8217;s fine, just throw someone else&#8217;s potential garbage in your app.  I&#8217;m sure it won&#8217;t bite until you least expect it.)</p>

<p>I&#8217;m getting back an <code>IOPMAssertionID</code>, so I proceed to look that up in the XCode documentation viewer. And there&#8217;s nothing to be found. A look in IOPMLib.h tells me it&#8217;s a 32-bit unsigned integer and therefore not very interesting.</p>

<p>So, I move on to look up <code>IOPMAssertionCreate()</code> to find that it was introduced in Leopard only to be deprecated in Snow Leopard in favor of <code>IOPMAssertionCreateWithName()</code>. <code>IOPMAssertionCreateWithName()</code> has an extra parameter over <code>IOPMAssertionCreate()</code>, and it&#8217;s a name as you might imagine. I don&#8217;t care for having deprecated calls in my code so <code>IOPMAssertionCreateWithName()</code> it is. <strong>Caveat</strong>: <code>IOPMAssertionCreateWithName()</code> is not <em>publicly</em> available in Leopard, so either use <code>IOPMAssertionCreate()</code> in Xcode3.1/Leopard or compile in XCode 3.2/Snow Leopard and <code>IOPMAssertionCreateWithName()</code> will work when run on Leopard.</p>

<p>The sample code from Apple lists two assertion types that you can use: <code>kIOPMAssertionTypeNoDisplaySleep</code> that prevents display sleep, and <code>kIOPMAssertionTypeNoIdleSleep</code> that prevents idle sleep.</p>

<p>My testing indicates that <code>kIOPMAssertionTypeNoDisplaySleep</code> actually prevents both display and idle sleep. The intended use case for this is clearly along the lines of playing a movie or running a presentation.</p>

<p><code>kIOPMAssertionTypeNoIdleSleep</code> will still allow the display to sleep, but the Mac never sleeps unless it runs out of battery power.  Use cases for this fall into the category of &#8216;computations that may not finish before the computer sleeps&#8217;, such as bouncing an mixed audio/video file to disk or rendering a 3D image, etc.</p>

<p>Here is an <a href='http://www.cimgf.com/wp-content/uploads/2009/10/DisableSleep.zip'>example project</a> that allows you to test both behaviors. <strong>Note:</strong> The project uses <code>IOPMAssertionCreate()</code> and not <code>IOPMAssertionCreateWithName()</code> in order to compile on both Leopard and Snow Leopard.</p>

<p>In keeping with good practice, I have filed bug reports with Apple for pieces of the documentation that I see as missing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cimgf.com/2009/10/14/the-journey-to-disabling-sleep-with-iokit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The audacity of [some] Windows Developers</title>
		<link>http://www.cimgf.com/2008/07/08/the-audacity-of-some-windows-developers/</link>
		<comments>http://www.cimgf.com/2008/07/08/the-audacity-of-some-windows-developers/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 05:00:19 +0000</pubDate>
		<dc:creator>Marcus Zarra</dc:creator>
				<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://www.cimgf.com/?p=139</guid>
		<description><![CDATA[Thanks to our beloved iPhone (I do refrain from calling it &#8220;My Precious&#8221;), we have seen a sudden influx of Windows Developers. Now, when most of us came over to OS X and Objective-C from whatever platform we hailed from we did not assume that everything would be the same. Most of us are reasonable [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to our beloved iPhone (I do refrain from calling it &#8220;My Precious&#8221;), we have seen a sudden influx of Windows Developers.  Now, when most of us came over to OS X and Objective-C from whatever platform we hailed from we did not assume that everything would be the same.  Most of us are reasonable people and realize that OS X is different <em>for a reason</em>.  Unfortunately, it appears that we are unusual people.  Perhaps this would explain why we came over to this platform before it became &#8220;popular&#8221;.</p>

<p>With this recent influx of developers, most of whom we have welcomed with open arms, there are some who expect everything to be the same as the platform they came from and without bothering to learn or experiment have proclaimed our development tools to be &#8220;prehistoric&#8221;.  This truly amazes me.</p>

<p>First, welcome to OS X and iPhone development.  This is not the same language, platform and API you have been dealing with.  Accept that or go home.  We are not going to change it to suit you.  We like it just the way it is.</p>

<p>We do things differently over here.  Accept that or go home.</p>

<p>You have an interest in either OS X or the iPhone.  To do a proper application for either one (barring a few edges cases), you need to learn Objective-C and Cocoa. Accept that &#8230; well you get the idea.</p>

<p>Objective-C has been around for a long time and it is a well thought out language.  It is a runtime focused language and therefore things work differently than you are used to in your more structured environments.</p>

<p>Most of the time when these so called developers complain about Objective-C I simply roll my eyes and walk the other way.  It is the sane thing to do.  Never wrestle with a pig &#8212; you get dirty and the pig likes it.  However, one particular &#8220;genius&#8221; has decided to out himself on his own blog.  Of course I speak of none other than <a href='http://weblogs.asp.net/jezell/archive/2008/07/06/iphone-sdk.aspx'>Jesse Ezell</a>.</p>

<p>It is clear from this blog post that he has no interest in learning why OS X, Cocoa and Objective-C are different from his beloved Visual Studio but instead cries that it is too hard.  I mean, seriously, complaining about NSObject vs Object?  Perhaps he did not bother to learn that there is more than one root object in Objective-C?  And then go to on and complain about MVC like its the devil&#8217;s music?  Hopefully he is not the best that .net has to offer us!</p>

<p>But even with all of that, I read his post, chucked and moved on.  It was not until he responded to the comments on that post that I decided to respond.  It seems, from his perspective, that if a developer cares enough about their development environment to respond to his rant (and try to educate him!) that we are all &#8220;rabit elitists&#8221; out to get him!</p>

<p>First the word is rabid, not rabit.  If you were using OS X you could have seen that it was misspelled and used the dictionary to figure out what the word meant.  If you can&#8217;t even bother to run a spellchecker why bother writing at all?</p>

<p>Second, we care about our platform.  We care about the code that we produce and how our applications look and are presented to the user.  I know that is probably an extremely foreign concept where he comes from.  But <strong><em>we care!</em></strong></p>

<p>When developers come over here with preconceptions they do everyone a disservice.  If they cannot even be bothered to pick up a book and read about the language to understand its fundamentals and its tools then why bother complaining about it.  They are a waste of space.  Move over and let someone who is willing to learn step up to the plate.</p>

<p>As for this developer&#8217;s ego and contempt for the developers on this platform &#8212; shame on him.  His arrogance speaks towards his ignorance.  He probably has written more lines of code in the past few years than I have.  I have found that applications on Windows tends to take ten times as many lines of code as the same application would written on Objective-C and Cocoa.  That does not make this developer better &#8212; if anything it makes him worse.</p>

<p>My suggestion is this: Pick up a book and <em>read</em>.  You can even just read blogs like this one and avoid having to pay any money to learn.  If a developer can&#8217;t be bothered then go home, we have no interest in you and certainly have no need for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cimgf.com/2008/07/08/the-audacity-of-some-windows-developers/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
