<?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; Development</title>
	<atom:link href="http://perspx.com/blog/archives/category/development/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>Making Cocoa list views really fast</title>
		<link>http://perspx.com/blog/archives/1427/making-list-views-really-fast/</link>
		<comments>http://perspx.com/blog/archives/1427/making-list-views-really-fast/#comments</comments>
		<pubDate>Thu, 20 May 2010 06:55:20 +0000</pubDate>
		<dc:creator>Perspx</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Echofon]]></category>
		<category><![CDATA[lists]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Tweetie]]></category>

		<guid isPermaLink="false">http://perspx.com/?p=1427</guid>
		<description><![CDATA[It seems that many of the apps in use today rely on or display feeds or lists of data; be that a Twitter timeline, an RSS feed or a list of history in a version control system, there&#8217;s a common trend in UI for using lists.
But displaying lists in applications can be much more than trivial, certainly for applications on  ... ]]></description>
			<content:encoded><![CDATA[<p>It seems that many of the apps in use today rely on or display feeds or lists of data; be that a Twitter timeline, an RSS feed or a list of history in a version control system, there&#8217;s a common trend in UI for using lists.</p>
<p>But displaying lists in applications can be much more than trivial, certainly for applications on Mac OS X, especially when you have to deal with large quantities of data, and have to solve problems such as variable row heights or changes to this information.</p>
<p>Ever since using <a href="http://www.atebits.com/tweetie-mac/">Tweetie</a>, a Twitter client for Mac OS X, from a development point of view I was always curious as to how the list view for the Twitter timeline was implemented; hundreds of rows of tweets can be displayed in this control, and the performance hit appears to be minimal; scrolling is smooth, there doesn&#8217;t appear to be a huge memory footprint. So how is it done?</p>
<h2>Lists in Tweetie</h2>
<p>If you <a href="http://www.codethecode.com/projects/class-dump/">class-dump</a> Tweetie, you can see three classes at work:</p>
<ul>
<li><strong>ABScrollView</strong>: A subclass of <code>NSScrollView</code>. It&#8217;s not clear as to why there is this subclass but an <code>ABColor</code> object is used for the background (as opposed to an <code>NSColor</code>).</li>
<li><strong>ABTableView</strong>: A subclass of <code>ABScrollView</code> which is used as the list control.</li>
<li><strong>ABTableViewCell</strong>: The cell class used to display each row in <code>ABTableView</code>.</li>
</ul>
<p>The interesting part of the class hierarchy is contained in <code>ABTableView</code> and <code>ABTableViewCell</code>. <code>ABTableView</code> is a subclass of <code>ABScrollView</code> (<em>not</em> <code>NSTableView</code>) and is a control which can display a list of <code>ABTableViewCell</code>s. However the real misnomer here is the <em>cell</em> part, because <code>ABTableViewCell</code> is a subclass of <code>NSView</code>, and not <code>NSCell</code>.</p>
<p><a href="http://perspx.com/wp-content/uploads/2010/04/TweetieClassDiagram.png"><img class="aligncenter size-full wp-image-1434" title="Tweetie lists class diagram" src="http://perspx.com/wp-content/uploads/2010/04/TweetieClassDiagram.png" alt="" width="356" height="313" /></a></p>
<p>So essentially what we have here is an implementation of something similar to <code>NSCollectionView</code>, which has a set of subviews which each represent a row and have their own place in the view hierarchy. But how, then, is the Tweetie list view so performant?</p>
<pre class="prettyprint">@interface ABTableView : ABScrollView
{
    ...
    NSMutableDictionary *reusableTableCells;
    ...
}

...
- (id)reusableCellsArrayForIdentifier:(id)arg1;
- (id)dequeueReusableCellWithIdentifier:(id)arg1;
...
@end</pre>
<h3>Reusing Cells</h3>
<p>The answer seems to lie in a method declared on <code>ABTableView</code>, which is <code>-dequeueReusableCellWithIdentifier:</code>. For those of you who are iPhone developers, you will be familiar with a method on <code>UITableView</code> with <em>exactly</em> the same method signature.</p>
<p>For those who aren&#8217;t, I shall explain: certainly compared to simple <code>NSCell</code> instances, <code>NSView</code> instances are pretty expensive. In fact, <code>NSCell</code> is <em>actually designed</em> as a &#8220;mechanism for displaying text or images in an NSView without the overhead of a full NSView subclass&#8221;<sup>1</sup>. In light of this, if we have 100, 1,000 – or even more – rows in a list, we don&#8217;t want the overhead of 1,000 instances of <code>NSView</code>, each used to represent a row. What&#8217;s more is that most of these cached views are wasted, since 1,000 rows cannot be displayed in the viewport at the same time. The iPhone takes advantage of this, and ensures that there are only enough view (in this case <code>UIView</code>) instances to cover the height of the table view; if the associated rows are scrolled off screen, then the views are removed from the view hierarchy.</p>
<p>Scrolling works much like laying down track for a train by picking up track from behind it; when a row is scrolled so that it is no longer visible, it is removed from the table view and &#8220;enqueued&#8221; (ie stored in an array); when a row that is not visible is scrolled so that it becomes visible, the data source should first check to see if there are any enqueued views, and if so it is then added to the view hierarchy and displayed.</p>
<p>What this means is that hundreds of rows can be displayed in one control without a large performance hit, and is one of the optimizations that makes the iPhone UI so responsive.</p>
<h2>Lists in Echofon</h2>
<p>After class-dumping, you can see that Echofon implements their list views in pretty much the same way as Tweetie, using two main classes:</p>
<ul>
<li><strong>FastTableView</strong>: A subclass of <code>NSScrollView</code> which is the list control.</li>
<li><strong>FastTableCell</strong>: A subclass of <code>NSView</code> which represents a cell used for the table view.</li>
</ul>
<p><a href="http://perspx.com/wp-content/uploads/2010/04/EchofonClassDiagram.png"><img class="aligncenter size-full wp-image-1438" title="Echofon Class Diagram" src="http://perspx.com/wp-content/uploads/2010/04/EchofonClassDiagram.png" alt="" width="356" height="253" /></a></p>
<p>Although not as explicit as the enquing/dequeuing in Tweetie&#8217;s list control, it would <em>seem</em> that <code>FastTableView</code> does a similar job as it has declared on it <code>-popCellForRow:fromArray:</code> and <code>-popSpareCell</code>.</p>
<p>Also to note is the use of <code>NSControl</code> and <em>not</em> <code>NSView</code> as the superclass of the table &#8220;cell&#8221; object, unlike with Tweetie. I would guess that this is for some of the additions that <code>NSControl</code> provides, perhaps the target/action mechanism.</p>
<h2>Final word</h2>
<p>When displaying large amounts of data in a list, as many applications do, often <code>NSTableView</code> is not enough. It is a pretty performant class, but when you start doing things with variable row heights, it isn&#8217;t really cut for the job. Nor is a class such as <code>NSCollectionView</code>; again it doesn&#8217;t implement variable row heights and lots of items can slow it down.</p>
<p>It seems that using view objects for each row, which have an established presence in the view hierarchy is the way to go, if you have the optimizations on top of this. For one you get the added convenience of using instances of <code>NSView</code>, and not simply working with <code>NSCell</code>.</p>
<p>As a final note, a quote I recall from <a href="http://www.zarrastudios.com/ZDS/Home/Home.html">Marcus Zarra</a>&#8217;s <a href="http://www.amazon.com/Core-Data-Apples-API-Persisting/dp/1934356328">book on Core Data</a> says:</p>
<blockquote><p>The lesson I took away from that story is to expect my users to put thousands of times as much data into my application as I would ever consider reasonable</p></blockquote>
<p>When working with large quantities of data, it is these kinds of optimizations that make your app more responsive and provide a better experience to the user.</p>
<div id="footnotes">
<h2>Footnotes</h2>
<ol>
<li>From <a href="http://developer.apple.com/mac/library/documentation/cocoa/conceptual/ControlCell/Concepts/AboutControlsCells.html">Control and Cell Programming Topics for Cocoa: About Cells and Controls</a></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://perspx.com/blog/archives/1427/making-list-views-really-fast/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The Psychology of Software</title>
		<link>http://perspx.com/blog/archives/1298/the-psychology-of-software/</link>
		<comments>http://perspx.com/blog/archives/1298/the-psychology-of-software/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 18:22:22 +0000</pubDate>
		<dc:creator>Perspx</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[users]]></category>

		<guid isPermaLink="false">http://perspx.com/?p=1298</guid>
		<description><![CDATA[Attending Matt Gemmell&#8217;s workshop last week was a great exercise for thinking from the user&#8217;s perspective – something which we, as software developers, often do not usually spend enough time doing because of being wrapped up in other things.
As developers, it is hard for us to detach ourselves from what we do and cater to the user. We live on  ... ]]></description>
			<content:encoded><![CDATA[<p>Attending <a href="http://perspx.com/blog/archives/1193/the-world-according-to-gemmell/">Matt Gemmell&#8217;s workshop</a> last week was a great exercise for thinking from the user&#8217;s perspective – something which we, as software developers, often do not usually spend enough time doing because of being wrapped up in other things.</p>
<p>As developers, it is hard for us to detach ourselves from what we do and cater to the user. We live on the other side of the fence and are often restrained from making the right decisions because of the way we think, and usually need an objective opinion. We have the curse of knowledge by being so deeply focused in on our software, and what seems intuitive and easy for us is unlikely going to be the same for the people who use our creations.</p>
<h2>Thinking from the user&#8217;s perspective</h2>
<p>The amazing thing about a lot of usability and application design is that <strong>most decisions come down to simple thought</strong> of how your software is going to be used, and to anticipate and accommodate the user&#8217;s various needs. It&#8217;s about thinking &#8220;I shouldn&#8217;t put that text field there because the relation to that other form is confusing&#8221; or &#8220;I should relabel that button because the current label is misleading&#8221;.</p>
<p>As software developers, <strong>our main subjects are not computers</strong> (even though we do instruct them on what to do) but rather <em>people</em>. We have to be psychologists to some degree and accommodate <em>their</em> needs – our software of which is an end to a means.</p>
<h2>The reality</h2>
<p>As Matt stated on an earlier MDN show podcast, users want to spend as <em>little</em> time in an application as possible, so that they can get on with their lives. But because we have an affinity with the software we produce it is often hard to detach ourselves from the way we go about our business and think in this way.</p>
<p>Of course this doesn&#8217;t mean that we shouldn&#8217;t design and architect our applications in a maintainable way, and doesn&#8217;t mean that we should write crap code that looks like something the dog threw up. However bear in mind that the user doesn&#8217;t actually <em>see</em> any of this. To paraphrase Gemmell again, all the user sees of our applications is the interface.</p>
<p>At the end of the day, users couldn&#8217;t care less whether you have a PHP backend or the UI implemented using Rails; they have such a different perspective of what we create. What they care about is <strong>how your software solves their problem</strong> and how it makes their life easier by doing so.</p>
]]></content:encoded>
			<wfw:commentRss>http://perspx.com/blog/archives/1298/the-psychology-of-software/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NSConference 2010: Mac Developer Conference (Day 2)</title>
		<link>http://perspx.com/blog/archives/1253/nsconf-2010-mac-developer-conference-day-2/</link>
		<comments>http://perspx.com/blog/archives/1253/nsconf-2010-mac-developer-conference-day-2/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 17:29:32 +0000</pubDate>
		<dc:creator>Perspx</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[nsconf]]></category>
		<category><![CDATA[nsconference]]></category>

		<guid isPermaLink="false">http://perspx.com/?p=1253</guid>
		<description><![CDATA[
It was the second and final day of the NSConference 2010 Mac Developer Conference and most delegates were tired and a little hungover. But there was another great line up of speakers for the day, and it was another day of socialising and fun, as well as all that other learning stuff.
Perhaps the biggest things I took away from the  ... ]]></description>
			<content:encoded><![CDATA[<div id="attachment_1275" class="wp-caption aligncenter" style="width: 610px"><img class="size-full wp-image-1275 " title="Core Audio" src="http://perspx.com/wp-content/uploads/2010/02/Core_audio.jpg" alt="" width="600" height="382" /><p class="wp-caption-text">Rentzsch on Core Audio: The API of Rock Stars</p></div>
<p style="text-align: center;">
<p>It was the second and final day of the <code>NSConference</code> 2010 Mac Developer Conference and most delegates were tired and a little hungover. But there was another great line up of speakers for the day, and it was another day of socialising and fun, as well as all that other learning stuff.</p>
<p>Perhaps the biggest things I took away from the Mac conference was taking a pragmatic approach to anything which became a recurring theme in a lot of the talks – like yesterday&#8217;s conference, extremes were presented such as Dave on not using singletons, but at the end of the day it&#8217;s a judgement call and you shouldn&#8217;t do or not do something &#8216;because Dave said it&#8217;, but rather because it&#8217;s either right or not right for what you want to do. There was also some recurring memes, such as The Matrix and kitties, which snuck their way into certain presenters&#8217; talks, but most of all, I learnt that people <em>can</em> be (fairly) civil when discussing version control, and also that the GPL <em>sucks</em>.<strong> </strong></p>
<h2>Jeff LaMarche – Writing Super Superclasses</h2>
<p><a href="http://perspx.com/wp-content/uploads/2010/02/lamarche_objc_runtime.jpg"><img class="alignleft size-full wp-image-1264" title="Jeff LaMarche" src="http://perspx.com/wp-content/uploads/2010/02/jeff_lamarche.jpg" alt="" width="288" height="230" /></a>Jeff was still jetlagged and tired, and made <em>several</em> comments as such throughout his talk. However, despite this, his talk on the Objective-C runtime was very interesting and informative to listen to. He started the talk off with a cliché – &#8216;you can&#8217;t see the forest through the trees&#8217; – and likened this to software development. As developers we are often too pedantic and only focus on the little things, but we also need to be able to step back and look at our projects as a whole on a larger scale.</p>
<p>He then went into the guts of his talk, talking about such things as dynamic method resolution and introspection at a lower level. He introduced Objective-C as different from other languages in terms of the patterns used and also touched on a criticism by others that it is missing things, however this is <em>by design</em> and not simply an oversight.</p>
<p>He then started talking about his <a href="http://code.google.com/p/sqlitepersistentobjects/">SQLitePersistentObjects</a> project which leverages the Objective-C runtime in several ways, and then demonstrated some of these features such as dynamic method resolution using IMPs and was well explained with the associated pros and cons of using certain runtime features.  Like many of the other talks, he explained the limitations of using the runtime, for example Apple <em>may</em><em> not</em> approve apps for the App store that use it, and also to be pragmatic about its use and not simply use it because you can.</p>
<h2>Andy Finnell – Brushing up on OpenCL</h2>
<p><a href="http://perspx.com/wp-content/uploads/2010/02/finnell_opencl.jpg"><img class="alignright size-full wp-image-1266" title="Andy Finnell" src="http://perspx.com/wp-content/uploads/2010/02/andy_finnell.jpg" alt="" width="288" height="194" /></a>I&#8217;ll be honest, after listening to Andy&#8217;s talk, I felt stupid. And I think there were other attendees around the room who were in a similar boat. He opened up with a demo, which was a great start to his talk, a demo which simulated the effect of watercolours on a canvas, and leveraged OpenCL to provide the graphics and calculate the drawing of the pigment and the interaction with the surface.</p>
<p>Although the maths and physics was way above me (and wasn&#8217;t helped by lack of sleep) it was still an informative and interesting talk, and I liked the structure of the presentation – cool demo at the beginning which made you interested then the rest of the time spent explaining how it all worked.</p>
<p>Andy also opened with a short intro on OpenCL and how it operated which was nice for those who hadn&#8217;t been at Drew&#8217;s Concurrency workshop on Sunday, however it would have been nice for this section to be expanded a bit, with less of a focus on the mechanics of the demo.</p>
<p>The presentation was also entertaining with accommodation for British spellings (&#8220;watercolo(u)r&#8221;) which is always a nice touch and other comical remarks and slides which helped a bit when it came to digesting the hardcore code samples. The coding side was also a nice contrast from the higher-level talks that were presented over both days of the Mac conference which also made it a useful and informative talk.</p>
<h2>Dave Dribin – Version Control System Shoot Out</h2>
<p>[Apologies for not having an accompanying photo]</p>
<p>Dave&#8217;s talk was all about version control and mostly a history or comparison of the different VCS&#8217;s out there. There was a feeling before the talk that <a href="http://twitter.com/creednmd/status/8539677234">it could go</a> <a href="http://twitter.com/pilky/status/8539592251">horribly wrong</a> but Dave kept it pretty objective and didn&#8217;t particularly favour any of the VCS&#8217;s.</p>
<p>He presented the history of version control systems first, with SCCS, RCS, CVS, SVN and other systems that use similar acronyms, before moving onto distributed version control with Git, Mercurial and Bazaar, quoting Linus&#8217;s talk where he explained the naming for Git: &#8216;I&#8217;m an egotistical bastard and I name all my products after myself, first Linux and now Git&#8217;. With all the version control systems he presented the pros and cons, and only discredited Git slightly. Overall a pretty well rounded talk for the allotted time of about 35 mins.</p>
<h2>Graham Lee – Code Signing</h2>
<p><a href="http://perspx.com/wp-content/uploads/2010/02/code_signing.jpg"><img class="alignleft size-full wp-image-1271" title="Graham Lee" src="http://perspx.com/wp-content/uploads/2010/02/graham_lee.jpg" alt="" width="320" height="206" /></a>Graham had been given the opportunity to present at very short notice, and it was very well executed. It was astounding the quality and detail of his talk despite the little preparation time that he had, and he had a great presentation style which was very entertaining. He also included lots of puns and other fun comments, such as a reference to a hypothetical harmful piece of injected code which he called Malicious Monster and also referenced as Malicious Library. For those who didn&#8217;t attend, the reference to the Matrix had become kind of a meme by this point and even though Graham had prepared his presentation in about 24 hours he still managed to fit it in.</p>
<p>He also did a live demo which was very useful and demonstrated some of the code signing in action; he also anticipated our needs well by cutting a few minutes short in aid of food. Overall a brilliant, informative presentation.</p>
<h2>Aaron Hillegass – The Many Faces of Data Persistence</h2>
<p><a href="http://perspx.com/wp-content/uploads/2010/02/hillegass_data_persistence.jpg"><img class="alignright size-full wp-image-1272" title="Aaron Hillegass" src="http://perspx.com/wp-content/uploads/2010/02/aaron_hillegass.jpg" alt="" width="320" height="269" /></a>Aaron&#8217;s talk was – as you probably guessed – focused on data persistence and the what the options are on Mac OS X. He started off by stating &#8216;The file is dead&#8217; and explaining how his HDD is essentially a cache for data that is stored in the Cloud, which prompted him to comment &#8216;Long live the cache!&#8217;. He used the example of iWork on the iPad in that it uses a &#8220;Library&#8221; to store files which is essentially an abstraction for the filesystem and that this is the way forward.</p>
<p>He then went on to talk about archiving in Cocoa and Cocoa Touch, discussing Keyed vs Unkeyed archiving and the associated pros and cons. He also presented a timeline of events in terms of data persistence, from the early 90&#8217;s with NeXT right up until Core Data in 2005. He presented some nicely formatted object graphs of some of the Core Data things which was also useful.</p>
<p>He spent most of the second half of the presentation talking about his new data persistence project, <a href="http://github.com/hillegass/BNRPersistence">BNRPersistence</a>, which provides classes that wrap Tokyo Cabinet which is used to store the data, which received much applause from everyone when he announced that it was open-source, available on GitHub, and <em>not</em> licensed under the GPL. It was certainly an interesting project and he had some numbers for certain cases compared to Core Data and it performed much faster. But he was dealing with object graphs that had 1K and 1M objects and for &#8220;everyday&#8221; use with smaller objects it was unclear whether BNRPersistence would be better than Core Data because he didn&#8217;t have any figures on it.</p>
<p>What I liked about Aaron&#8217;s talk which I don&#8217;t think any of the other speakers did was that he was more engaging with everyone whilst he was talking – his style was like a lecture, but he periodically checked that we were all following everything, something which I guess comes from the teaching which he does, and was a nice touch.</p>
<h2>Cocoa Rumble</h2>
<p><a href="http://perspx.com/wp-content/uploads/2010/02/cocoa_rumble.jpg"><img class="alignleft size-full wp-image-1285" title="Cocoa Rumble" src="http://perspx.com/wp-content/uploads/2010/02/cocoa_rumble_small2.jpg" alt="" width="320" height="192" /></a>The rest of the allotted time had been reserved for something different, in the form of a &#8220;Cocoa Rumble&#8221;. Earlier in the day, Scotty had announced that people could put their names in a hat to be chosen for this mystery event. Names were picked out of this hat and each person chosen was assigned a speaker from the conference.</p>
<p>The combined speakers and delegates were then split up into three groups and had to pick from the hat which now contained another set of slips of paper, which had written on them different &#8220;Core–&#8221; frameworks. The three chosen were Core Text, Core Audio and Core Image, and the teams had some time to prepare a presentation for why their framework was the &#8220;Core of the Year&#8221;. All presentations were very entertaining, with talks from Mike, Wolf and Graham and at the end, Core Image (presented by Graham) won for the compelling reasons that he had put into a table.</p>
<p>Whilst the teams were preparing, there was also a chance for the speakers and some of the delegates to provide tips, and there were some great tips from such people as <a href="http://twitter.com/uliwitness">Uli</a> who provided a load of cool Xcode tips, Aaron on <a href="http://twitter.com/Perspx/status/8549070326">having the old Xcode documentation browsing behaviour</a>, and Jeff on conditional build settings.</p>
<p>A nice fun end to the day, with something different and all in the community and social spirit.</p>
<h2>Final thoughts</h2>
<p>It was my last day of <code>NSConference</code> and what a brilliant conference it had been, with Matt Gemmell&#8217;s workshop on Sunday and the Mac developer conference too. It was great to socialise with loads of Mac developers who were all really friendly and I entered into some interesting discussions, and I took a great deal away from the conference which was something that Scotty laid out as one of the goals at the beginning.</p>
<p>I would like to thank Scotty, Tim, Dave, Rob, Simon and all the other people who made <code>NSConference</code> possible, because it was a great experience indeed, and to all the great people that I met there. Thanks also to Uli for setting up the <a href="http://twitter.com/nsconfr">NSConference Reflector</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://perspx.com/blog/archives/1253/nsconf-2010-mac-developer-conference-day-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSConference 2010: Mac Developer Conference (Day 1)</title>
		<link>http://perspx.com/blog/archives/1210/nsconference-2010-mac-developer-conference-day-1/</link>
		<comments>http://perspx.com/blog/archives/1210/nsconference-2010-mac-developer-conference-day-1/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 08:21:54 +0000</pubDate>
		<dc:creator>Perspx</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[nsconf]]></category>
		<category><![CDATA[nsconference]]></category>

		<guid isPermaLink="false">http://perspx.com/?p=1210</guid>
		<description><![CDATA[
It was the first day of the NSConference 2010 Mac developer conference and a great lineup was ahead.
In terms of the day generally, it was a brilliant experience. It was well organised and many thanks go to Scotty, Tim, Dave and all the other NSConference staff. The WiFi (although irritating that you had to keep filling out the signup form)  ... ]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://perspx.com/wp-content/uploads/2010/02/nsconf.jpg"><img class="aligncenter size-full wp-image-1249" title="NSConference" src="http://perspx.com/wp-content/uploads/2010/02/nsconf.jpg" alt="" width="640" height="330" /></a></p>
<p>It was the first day of the <code>NSConference</code> 2010 Mac developer conference and a great lineup was ahead.</p>
<p>In terms of the day generally, it was a brilliant experience. It was well organised and many thanks go to Scotty, Tim, Dave and all the other <code>NSConference</code> staff. The WiFi (although irritating that you had to keep filling out the signup form) worked quite well and you could get some pretty good speeds, which was good considering that the room was filled with over 100 developers, almost all of which I imagine had a Mac or iPhone for most of the day.</p>
<p>It was also a great social event, and the breaks were a nice chance to go around and talk to someone you&#8217;d never met before and have some interesting discussions. It was also nice to be in this tight community, separated from all the &#8220;normal&#8221; people who were also around at the venue.</p>
<p>In terms of the talks generally, I felt that they were all very well done and it was clear that they had put a lot of work into them. The presentations were very well laid out and simple, and not wordy and the speakers all obviously knew what they were talking about and had lots of interesting things to say. However one big thing that I felt could be improved on was the interaction with the audience – that is, many of the slides were in more of a lecture-style and although a couple made up for this with a Q&amp;A at the end I thought this could be improved upon.</p>
<h2>The Speakers</h2>
<h3>Scotty</h3>
<p><a href="http://perspx.com/wp-content/uploads/2010/02/IMG_1426.jpg"><img class="alignleft size-full wp-image-1224" title="Scotty" src="http://perspx.com/wp-content/uploads/2010/02/scotty_thumb.jpg" alt="" width="294" height="211" /></a>Scotty kicked off the morning with a nice introduction to the conference, welcoming everyone and thanking us all for being here. He presented his recent case of being rushed into hospital for a &#8220;routine&#8221; operation as a metaphor for what we&#8217;re doing here, and he explained how even though he has little knowledge of the detailed ins and outs of the medical profession, he had a respect for them due to the reputation that the collective members have earned over the years. This was related to Mac development and <em>our</em> collective &#8216;responsibility to the platform&#8217; and what we do, and the expectations of the Mac or iPhone platforms which is ultimately our responsibility. He also talked about how there is pioneering but also sharing of ideas in the medical profession and again linked this to our role in the Mac/iPhone/iPad community.</p>
<p>He also went on to talk about the community spirit, and emphasised that all the speakers had given up their own time (and money) to be here which because of this, and was a nice to start the day.</p>
<h3>Mike Lee – Conference Keynote: Engineering Life</h3>
<p><a href="http://perspx.com/wp-content/uploads/2010/02/IMG_1430.jpg"><img class="alignright size-full wp-image-1226" title="Mike Lee" src="http://perspx.com/wp-content/uploads/2010/02/mike_lee_thumb.jpg" alt="" width="294" height="218" /></a>Mike&#8217;s presentation was evidently something slightly different and original to start the day but was a nice sideline to our ability to crank code, and was more thinking at a higher level about what we do, and perhaps being a bit more philosophical about it. He was relating what we do and our profession to life in general, and how we can &#8216;engineer life&#8217;. He defined <em>problems</em> as &#8216;reality we do not like&#8217; which was a topical tie-in with software development since problem solving is one of the key aspects to what we do.</p>
<p>Mike also used several anecodes during his presentation which brought in a realistic sense rather than something purely theoretical, reality which is often missed when talking about software and software development, with purely theoretical statements. He also likened the Universe to a computer in that both are simply entities which are constantly changing state.</p>
<p>The next part of the talk became perhaps a little morbid with discussion on &#8216;Death 101&#8242; with the conclusion that &#8216;death sucks&#8217; but you can&#8217;t really do anything about it and you&#8217;ll be dead in the ground so won&#8217;t care about it anyway. However he also likened this to fear and how you can engineer your way around fear and tackle it head-on rather than let it get the better of you. He also talked about having a legacy and a part of you that lives on when you die by accomplishing something that you are remembered for, which can perhaps give you a kind of immortality.</p>
<p>He finished on the note of &#8216;be the hero&#8217;, and overall the talk was an interesting and somewhat unusual. I heard later on that there was about a 50/50 split on people who liked/disliked the presentation but I thought it was an interesting, though-provoking topic and good to be a part of.</p>
<h3>Wolf Rentzsch – Spelunking OS X</h3>
<p><a href="http://perspx.com/wp-content/uploads/2010/02/IMG_1434.jpg"><img class="alignleft size-full wp-image-1227" title="Wolf Rentzsch" src="http://perspx.com/wp-content/uploads/2010/02/wolf_rentzsch_thumb.jpg" alt="" width="294" height="221" /></a>Wolf started with the statement that he had &#8216;90 slides in 60 minutes&#8217; and it was pretty fast-paced, although for the most part fine to follow. He dug into Mac OS X under the hood and ways you can access this information and interact with it, introducing such tools as otx, otool and class-dump.</p>
<p>The low-level nature of his talk was a great contrast to Mike&#8217;s previous talk which was a demonstration of the breadth of talks within <code>NSConference</code> and was more of a code and tool-based talk. He introduced hexadecimal editors such as HexFiend, which &#8216;are your friend&#8217;, then went on to deal with different sections with prying into OS X internals such as static analysis with strings and files, and code injection.</p>
<p>The great part of presenting these tools was the accompanying screenshots of a terminal and the associated output, and also examples of useful commands and how they could be used, which was probably the killer feature of the presentation for me. He also had a clear presentation style and after talking to him later at the bar was a nice, bubbly person to talk to and obviously knows his stuff.</p>
<p>As a suggestion for improvement it would have been nice to see a live demo of some of the tools in action – he had some screenshots of probing applications such as TextEdit, but a live demo of the tools live would have been a nice addition.</p>
<h3>Dave Dribin – Clean Code</h3>
<p><a href="http://perspx.com/wp-content/uploads/2010/02/IMG_1437.jpg"><img class="alignright size-full wp-image-1229" title="Dave Dribin" src="http://perspx.com/wp-content/uploads/2010/02/dave_dribin_thumb.jpg" alt="" width="294" height="230" /></a>I think that Dave&#8217;s presentation was perhaps my favourite of the day and talked about different ways of writing clean code and bad ways that can introduce &#8220;code smell&#8221; and ways to get around this and I agree that it is an important part of being a programmer.</p>
<p>He used the analogy of the iPhone as a way into the presentation; with the divide between internal and external quality – the external beauty is the interface that is seen by the user but the internals are the code that we write and sits behind the scenes. With an application it&#8217;s the difference between a beautiful interface and the underlying implementation of that in code.</p>
<p>The presentation was filled with quite a lot of tips, such as guidelines on naming classes and common principles such as DRY (Don&#8217;t Repeat Yourself) and OAOO (Once and Only Once) with the example of using enumerations or constants for dictionary keys instead of repeating strings throughout your code.</p>
<p>The Q&amp;A was also useful and for most of the other talks there wasn&#8217;t time so it was a nice feature to be able to ask questions about the content discussed.</p>
<h3>Drew McCormack – Data Presentation in Mac Apps</h3>
<p><a href="http://perspx.com/wp-content/uploads/2010/02/IMG_1438.jpg"><img class="alignleft size-full wp-image-1230" title="Drew McCormack" src="http://perspx.com/wp-content/uploads/2010/02/drew_mccormack_thumb.jpg" alt="" width="294" height="214" /></a>Drew lead into the presentation by talking about his scientific background and explaining how different data can be displayed and visualised in different ways. His presentation was also nice because it was one of the ones that wasn&#8217;t directly related to churning code and was more about the UI and talking about the various controls – standard or custom – and where they are best used.</p>
<p>I liked the format of looking at these different controls – he presented images of each and then talked about the advantages and disadvantages of each. This was particularly useful when comparing controls, such as the <code>NSTableView</code> and the <code>NSCollectionView</code>, and his slides were perhaps the best of the day and contained very little text on them, just visual cues such as images and the likes.</p>
<p>To this end I learnt a lot about how different views are implemented – he explained using Tweetie (Mac) as an example that it uses an <code>NSTableView</code> to display its list of data, and also Versions implements some of its custom controls using HTML, CSS and Javascript with WebKit.</p>
<p>Near the end he did talk about non-standard controls and focused on drawing graphs with CorePlot. However he spent quite a long time talking about this, which although interesting it would have been nicer if he&#8217;d demonstrated a few more, different controls.</p>
<h3>Marcus Zarra – Core Animation</h3>
<p><a href="http://perspx.com/wp-content/uploads/2010/02/IMG_1440.jpg"><img class="alignright size-full wp-image-1231" title="Marcus Zarra" src="http://perspx.com/wp-content/uploads/2010/02/marcus_zarra_thumb.jpg" alt="" width="294" height="209" /></a>Marcus started his talk by explaining how Core Animation wasn&#8217;t just for designers, and used himself as an example of a non-designer, but that it could still be used to enhance or help create sleek interfaces. However he also warned that Core Animation can easily be overused and turn a simple, clean UI into something horrible and even very unintuitive. He also explained how Core Animation, although its interface is quite simple, it is also very powerful.</p>
<p>He gave a few examples of using Core Animation, and then gave a live demo of an application that was doing lots of complex animations using Core Animation and how smooth and seamless they all were. It was evident that he had spent a lot of time on the project and he explained how the rotating gears displayed were constructed as paths which was a nice touch to the talk, to get a real demo application.</p>
<p>However even though he had an hour slot, he only used about 35 minutes talking and left the rest of the time for questions, which was quite a nice idea since it was more engaging with everyone rather than simply a lecture. However, it would have been nice for him to use more of his allotted time to show some more Core Animation examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://perspx.com/blog/archives/1210/nsconference-2010-mac-developer-conference-day-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parsing command line arguments with NSUserDefaults</title>
		<link>http://perspx.com/blog/archives/1122/parsing-command-line-arguments-nsuserdefaults/</link>
		<comments>http://perspx.com/blog/archives/1122/parsing-command-line-arguments-nsuserdefaults/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 19:18:29 +0000</pubDate>
		<dc:creator>Perspx</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[command line arguments]]></category>
		<category><![CDATA[NSArgumentDomain]]></category>
		<category><![CDATA[NSUserDefaults]]></category>

		<guid isPermaLink="false">http://perspx.com/?p=1122</guid>
		<description><![CDATA[The NSUserDefaults class provides Cocoa applications access to the underlying Mac OS X defaults system, and can be used to store and persist user preferences.
Whilst providing an interface to the defaults system, the NSUserDefaults class can also be used to access command line arguments that were passed when the executable was launched, which have already been parsed and are accessed  ... ]]></description>
			<content:encoded><![CDATA[<p>The <code>NSUserDefaults</code> class provides Cocoa applications access to the <a href="http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/defaults.1.html">underlying Mac OS X defaults system</a>, and can be used to store and persist user preferences.</p>
<p>Whilst providing an interface to the defaults system, the <code>NSUserDefaults</code> class can also be used to access command line arguments that were passed when the executable was launched, which have already been parsed and are accessed in the same way that other defaults are. This can be a great convenience when dealing with applications that accept command line arguments, such as command line tools.</p>
<h2>Defaults domains</h2>
<p>Defaults are organised into <em>domains</em>, each of which are assigned a name and are used to separate defaults intended for different purposes. Domains can either be <em>persistent</em> or <em>volatile</em> – persistent domains persist their defaults to disk and remain if the application is terminated and relaunched. Volatile domains only exist from the point at which they are created to when the user defaults object is deallocated.</p>
<p>The standard defaults domains – listed in order of precedence – are:</p>
<ol>
<li><code>NSArgumentDomain</code> – this is a volatile domain that contains any command line arguments that were passed when the application was executed.</li>
<li>The application-specific domain – the persistent domain that is based on the application&#8217;s bundle identifier. At current the defaults for this domain are stored in a .plist file at <code>~Library/Preferences/&lt;ApplicationIdentifier&gt;.plist</code></li>
<li><code>NSGlobalDomain</code> – a global defaults domain that is intended for use by all applications running under the user that the domain applies to.</li>
<li>Languages Domain – these are volatile domains used for language-specific defaults based on languages set in the <code>NSGlobalDomain</code> under the <code>AppleLanguages</code> key.</li>
<li><code>NSRegistrationDomain</code> – a volatile domain that allows &#8220;factory settings&#8221; to be set by the application. This provides a fallback so that the application can always rely on <code>NSUserDefaults</code> to return a value for certain defaults, even if they have not yet been overridden and saved in the defaults database in the application-specific or global domain (this is useful on first launch, for example).</li>
</ol>
<p>The order of precedence is important – when you request a value for a given key, the defaults domains are searched in this order. The first key that is found that matches the requested key is used. This means that, for example, if a key is present in the application-specific domain and also in the global domain, the value set in the application-specific domain will always be found first and used.</p>
<h2>Parsing command line arguments with the NSArgumentDomain</h2>
<p>The <code>NSArgumentDomain</code> is a particularly useful domain for applications that use command line arguments.  The domain is volatile, and when created the defaults dictionary is populated with any command line arguments that were passed when the application was executed.</p>
<p>Command line arguments that can be parsed and used by the <code>NSArgumentDomain</code> must take the format:</p>
<pre>-name value</pre>
<p>The argument is stored as a default with key of <em>name</em> and value of <em>value</em>.</p>
<p>At this point accessing values passed in on the command line is the same process for accessing any other defaults. For example running an application as such:</p>
<pre>MyApplication -aString "Hello, World" -anInteger 10</pre>
<p>Allows the command line arguments to be retrieved as such:</p>
<pre class="prettyprint">NSUserDefaults *standardDefaults = [NSUserDefaults standardUserDefaults];

NSString *aString = [standardDefaults stringForKey:@"aString"];
NSInteger anInteger = [standardDefaults integerForKey:@"anInteger"];

NSLog (@"aString argument: %@\nanInteger argument: %d", aString, anInteger);</pre>
<p>With the following output:</p>
<pre>aString argument: Hello, World
anInteger argument: 10</pre>
<h2>The importance of domain precedence</h2>
<p>The <code>NSArgumentDomain</code> has the highest precedence when a key is searched for in the user defaults, and as such defaults set in different domains with the same keys as the command line arguments will be temporarily overridden. For example, if the application is invoked from the command line as follows:</p>
<pre>MyApplication -myKey "Foo"</pre>
<p>but <code>myKey</code> also exists in the application-specific defaults domain with a value of &#8220;Bar&#8221;, then calling:</p>
<pre class="prettyprint">[[NSUserDefaults standardUserDefaults] valueForKey:@"myKey"];</pre>
<p>will return &#8220;Foo&#8221;. The default set in the application-specific domain is <em>not</em> overwritten, but the default in the <code>NSArgumentDomain</code> is encountered first as it has the highest precedence.</p>
]]></content:encoded>
			<wfw:commentRss>http://perspx.com/blog/archives/1122/parsing-command-line-arguments-nsuserdefaults/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PXSourceList: Source List Control for Mac OS X</title>
		<link>http://perspx.com/blog/archives/1096/pxsourcelist/</link>
		<comments>http://perspx.com/blog/archives/1096/pxsourcelist/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 17:02:31 +0000</pubDate>
		<dc:creator>Perspx</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[source list]]></category>

		<guid isPermaLink="false">http://perspx.com/?p=1096</guid>
		<description><![CDATA[Source Lists feature in many Mac OS X applications. From iTunes to iCal to Versions, they are a great navigation control.
But for us Cocoa developers, they aren&#8217;t that easy to implement. You can easily create an NSOutlineView and set its highlight mode to &#8220;Source List&#8221; but none of the other Source List features come built in out of the box,  ... ]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.apple.com/Mac/library/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGWindows/XHIGWindows.html#//apple_ref/doc/uid/20000961-CHDDIGDE" target="_blank">Source Lists</a> feature in many Mac OS X applications. From iTunes to iCal to Versions, they are a great navigation control.</p>
<p>But for us Cocoa developers, they aren&#8217;t that easy to implement. You can easily create an <code>NSOutlineView</code> and set its highlight mode to &#8220;Source List&#8221; but none of the other Source List features come built in out of the box, such as the ability to display badges or icons for items.</p>
<div id="attachment_1103" class="wp-caption aligncenter" style="width: 595px"><a href="http://perspx.com/wp-content/uploads/2010/01/pxsourcelist1.jpg"><img class="size-full wp-image-1103" title="PXSourceList" src="http://perspx.com/wp-content/uploads/2010/01/pxsourcelist1.jpg" alt="" width="585" height="322" /></a><p class="wp-caption-text">PXSourceList</p></div>
<p>I created <code>PXSourceList</code> to help address this issue. It is a reusable control (within the context of Source Lists) compatible with Mac OS X 10.5 and higher. It makes implementing Source Lists in your applications easier by adding the following main features:</p>
<ul>
<li>Automatic <em>Group</em> highlighting of top-level items – the text for Group items appears in a dark blue colour and is normally displayed as capitalized.</li>
<li>Support for <em>Badges</em> – these are dark blue capsules displayed to the right of certain items that display a number.</li>
<li>The option to display an <em>Icon</em> for each row – a small image that provides extra visual information for each row.</li>
<li>Right-clicking support to display context menus.</li>
</ul>
<h2>Getting the control</h2>
<p>The source is available to download <a href="http://github.com/Perspx/PXSourceList">from GitHub</a>.</p>
<h2>More Information</h2>
<p>More information about <code>PXSourceList</code> is available from the <a href="http://perspx.com/software/PXSourceList/">project page</a>.</p>
<p>There is also documentation available – a link to this can be found on the <a href="http://perspx.com/software/PXSourceList/">main project page</a> or from the <a href="http://github.com/Perspx/PXSourceList/">page on GitHib</a>.</p>
<p>If you have any other questions then feel free to <strong><a href="http://perspx.com/contact/">get in touch</a></strong> and I&#8217;ll be happy to help.</p>
]]></content:encoded>
			<wfw:commentRss>http://perspx.com/blog/archives/1096/pxsourcelist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful Interface Builder Features</title>
		<link>http://perspx.com/blog/archives/1003/useful-interface-builder-features/</link>
		<comments>http://perspx.com/blog/archives/1003/useful-interface-builder-features/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 20:26:05 +0000</pubDate>
		<dc:creator>Perspx</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[cocoa-touch]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[interface builder]]></category>
		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">http://perspx.com/?p=1003</guid>
		<description><![CDATA[Interface Builder is one of Apple&#8217;s developer tools, used to design interfaces for both Mac OS X and iPhone applications, and in most instances saves developers huge amounts of time from having to write the equivalent code, whilst also providing a useful visual representation of the interfaces they are working on.
Some developers try and fight Interface Builder, and would rather  ... ]]></description>
			<content:encoded><![CDATA[<p>Interface Builder is one of Apple&#8217;s developer tools, used to design interfaces for both Mac OS X and iPhone applications, and in most instances saves developers huge amounts of time from having to write the equivalent code, whilst also providing a useful visual representation of the interfaces they are working on.</p>
<p>Some developers <a href="http://stackoverflow.com/questions/717442/how-do-i-create-cocoa-interfaces-without-interface-builder" target="_blank">try and fight</a> Interface Builder, and would rather code up the interfaces rather than let Interface Builder do most of the work for them. Of course, there are instances where this may be useful, but in the grand scheme of things IB is a tool which has lots of useful features that makes interface design a much easier process.</p>
<h2>Layout and alignment</h2>
<p>Interface Builder provides blue guides to aid positioning of objects, in accordance with the <a href="http://perspx.com/blog/archives/454/apple-human-interface-guidelines/" target="_blank">Apple Human Interface Guidelines</a>. However, if you want a tighter grain of control over the layout, there are other guides which help you with this.</p>
<p>Pressing <strong>option</strong> with an interface object selected causes red arrows to be displayed on the four sides of the object, with labels displaying the number of pixels from the frame of the object to the edges of the container.</p>
<p style="text-align: center;"><a href="http://perspx.com/wp-content/uploads/2010/01/option-spacing-guides.jpg"><img class="aligncenter size-full wp-image-1017" title="IB Layout: Spacing guides" src="http://perspx.com/wp-content/uploads/2010/01/option-spacing-guides.jpg" alt="" width="337" height="262" /></a></p>
<p>With the option key still held down, placing the cursor over another interface object will show you the spacing between the frame of the selected object and the frame of the object you have the cursor over. This can be useful in times when making sure objects have equal alignments with neighbouring objects, or within the window itself.</p>
<p style="text-align: center;"><a href="http://perspx.com/wp-content/uploads/2010/01/option-spacing-guides2.jpg"><img class="aligncenter size-full wp-image-1018" title="IB Layout: Spacing guides" src="http://perspx.com/wp-content/uploads/2010/01/option-spacing-guides2.jpg" alt="" width="332" height="255" /></a></p>
<p>There are also the <em>Align Vertical Center in Container</em> and <em>Align Horizontal Center in Container</em> options from the <em>Layout &gt; Alignment</em> menu which are useful in centering objects within their container (and which I personally think should also have keyboard shortcuts associated with them).</p>
<p style="text-align: center;"><a href="http://perspx.com/wp-content/uploads/2010/01/alignment.jpg"><img class="aligncenter size-full wp-image-1019" title="IB Layout: Alignment menu" src="http://perspx.com/wp-content/uploads/2010/01/alignment.jpg" alt="" width="410" height="309" /></a></p>
<h2>Option-drag to duplicate objects</h2>
<p>It really does what it says on the tin. To duplicate objects just hold down the option key then drag an object. A clone of the object will be created which you can then move to the desired location.</p>
<p style="text-align: center;"><a href="http://perspx.com/wp-content/uploads/2010/01/option-drag.jpg"><img class="aligncenter size-full wp-image-1021" title="IB: Option-drag to duplicate objects" src="http://perspx.com/wp-content/uploads/2010/01/option-drag.jpg" alt="" width="377" height="247" /></a></p>
<h2>Decompose and Simulate Interface</h2>
<p>These are two useful options that are accessible from the <em>File</em> menu.</p>
<p style="text-align: center;"><a href="http://perspx.com/wp-content/uploads/2010/01/decompose_simulate_interface.jpg"><img class="aligncenter size-full wp-image-1022" title="IB File Menu" src="http://perspx.com/wp-content/uploads/2010/01/decompose_simulate_interface.jpg" alt="" width="341" height="309" /></a></p>
<p>The first is <em>Decompose Interface</em>. An advantage of using NIBs is that they can be loaded lazily – that is, only when the contained objects are actually needed by the application. This can reduce the memory footprint and loading times, which is particularly useful when developing iPhone applications due to the somewhat limited system resources available.</p>
<p>Therefore a common design pattern for Cocoa/Cocoa-Touch applications is to share different objects – be that menus, windows, view controllers and such – across multiple nibs – not necessarily one per nib, but perhaps two or three that are needed for a particular part of the application and have to be loaded together. What the <em>Decompose Interface</em> action does is split objects in the current nib into separate nibs, which can then be saved and then loaded lazily by the application in this way.</p>
<p>The other action, <em>Simulate Interface</em>, is a convenience when designing an interface; instead of having to go back to Xcode and Build and Run to see what the interface looks like, you can do it straight from Interface Builder, which will simulate the current window and its contents.</p>
<p>However, note that if you use any custom views, any custom visual or behavioural attributes will not be implemented by the simulator – it does not build your application, just simulates the available objects used by your interfaces from the Library.</p>
<h2>Size to Fit</h2>
<p><em>Size to Fit</em> is an option available from the <em>Layout</em> menu (or ⌘=) which resizes a view to a size just large enough to fit its contents.</p>
<p><a href="http://perspx.com/wp-content/uploads/2010/01/sizetofit.jpg"><img class="aligncenter size-medium wp-image-1023" title="IB: Size To Fit menu option" src="http://perspx.com/wp-content/uploads/2010/01/sizetofit-300x155.jpg" alt="" width="300" height="155" /></a></p>
<p>This is useful after changing the contents of an element to then resize it to just the right size to fit its contents.</p>
<h2>Precise selection of Views in the view hierarchy</h2>
<p>This is another really useful feature of Interface Builder; when making a selection, hold down <strong>shift</strong> and then <strong>right-click</strong> on an element. A menu will pop up, which lists the views in the view hierarchy for that element, from the enclosing Window (or other appropriate top-level container) to the interface object that you have clicked on. For example, when clicking on an <code>NSButton</code>, the menu lists <em>Window, Content View, Push Button</em> and<em> Button Cell</em>.</p>
<p style="text-align: center;"><a href="http://perspx.com/wp-content/uploads/2010/01/rightclickselection.png"><img class="aligncenter size-full wp-image-1024" title="rightclickselection_thumb" src="http://perspx.com/wp-content/uploads/2010/01/rightclickselection_thumb.png" alt="" width="290" height="315" /></a></p>
<p>Where I&#8217;ve found this to be particularly useful is with Table Views; the particular part of the table that you want to select very much depends on what you want to do; if you are binding to a column for instance, you will want to select the table column; if you are resizing the headers, you will want to select the header view; if you want to change the row height, you want to select the Table View itself, and so forth.</p>
<p>Selection of these individual components is rather difficult and annoying, and you often have to time your clicks appropriately to select the part of the Table View that you want. However, shift-right-clicking on the Table View means that you can select the appropriate item – be that the table column, the cell for a column or the Table View itself – by selecting the appropriate item from the popup menu.</p>
<h2>Smart Groups</h2>
<p>Smart Groups can be created in Interface Builder much like smart groups in applications such as the Finder or iTunes. These are listed in the Library window, along with the other object groupings.</p>
<p style="text-align: center;"><a href="http://perspx.com/wp-content/uploads/2010/01/smart-groups.png"><img class="aligncenter size-full wp-image-1027" title="smart groups_thumb" src="http://perspx.com/wp-content/uploads/2010/01/smart-groups_thumb.png" alt="" width="464" height="264" /></a></p>
<p>Smart Groups provide a means of filtering objects based on a predicate (or filter) based on such properties as object label, the most recently used objects, or the kind of class an object is. This last property can be especially useful. For example, if you want a Smart Group that lists all <code>NSView</code> objects or subclasses, you can set the predicate to:</p>
<pre>&lt;Is A Kind Of&gt; NSView</pre>
<p>And the group will contain all <code>NSView</code> classes or subclasses.</p>
<p>Smart Groups can be created by clicking on the actions button at the bottom of the Library window and selecting <em>New Smart Group</em>.</p>
<p style="text-align: center;"><a href="http://perspx.com/wp-content/uploads/2010/01/new_smart_group.jpg"><img class="aligncenter size-full wp-image-1038" title="IB: New Smart Group" src="http://perspx.com/wp-content/uploads/2010/01/new_smart_group.jpg" alt="" width="290" height="259" /></a></p>
<h2>Font Menu</h2>
<p>Another useful menu is the <em>Font</em> menu, which allows you to set the font and font attributes of items in your interface. This can be useful when setting fonts of controls or cells, such as changing the font size, weight or colour of a cell in an <code>NSTableView</code>, for example, which saves you having to do it with code.</p>
<p><a href="http://perspx.com/wp-content/uploads/2010/01/fontsmenu.jpg"><img class="aligncenter size-full wp-image-1030" title="IB Font Menu" src="http://perspx.com/wp-content/uploads/2010/01/fontsmenu.jpg" alt="" width="241" height="342" /></a></p>
<h2>Info Panel</h2>
<p>The Info panel provides useful information about the nib that you are currently editing and its contained objects. It allows you to specify a deployment and development target, and shows any errors that your interface may have when deploying to that target.</p>
<p style="text-align: center;"><a href="http://perspx.com/wp-content/uploads/2010/01/Info-panel.jpg"><img class="aligncenter size-full wp-image-1029" title="IB Info Panel" src="http://perspx.com/wp-content/uploads/2010/01/Info-panel.jpg" alt="" width="462" height="265" /></a></p>
<p>For example, placing an <code>NSCollectionView</code> instance in a window and selecting a deployment target of Mac OS X 10.4 will show an error that the <code>NSCollectionView</code> class is not supported on versions of OS X prior to 10.5.</p>
<p>The Info panel can also show useful information about layout, for example if a window lies partially hidden off the screen which means that it will be partially hidden from view when unarchived and displayed.</p>
]]></content:encoded>
			<wfw:commentRss>http://perspx.com/blog/archives/1003/useful-interface-builder-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
		<item>
		<title>Stack Overflow DevDays Cambridge</title>
		<link>http://perspx.com/blog/archives/565/devdays-cambridge/</link>
		<comments>http://perspx.com/blog/archives/565/devdays-cambridge/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 12:24:03 +0000</pubDate>
		<dc:creator>Perspx</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[DevDays]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[stack overflow]]></category>

		<guid isPermaLink="false">http://oneinfinitemonkey.wordpress.com/?p=565</guid>
		<description><![CDATA[
Cambridge was the penultimate city of the Stack Overflow DevDays world (or America and Europe) tour and was situated at Robinson College at Cambridge University. The day was a great opportunity to see introductory presentations on the hotness in the developer community, and also to meet other devs and heroes of mine. The Carsonified team (who were running the events)  ... ]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><a href="http://perspx.com/wp-content/uploads/2009/10/devdays1.jpg"><img class="aligncenter size-large wp-image-864" title="DevDays" src="http://perspx.com/wp-content/uploads/2009/10/devdays1-1024x768.jpg" alt="" width="491" height="369" /></a><br />
Cambridge was the penultimate city of the Stack Overflow DevDays world (or America and Europe) tour and was situated at Robinson College at Cambridge University. The day was a great opportunity to see introductory presentations on the hotness in the developer community, and also to meet other devs and <a href="http://codinghorror.com" target="_blank">heroes</a> of <a href="http://joelonsoftware.com" target="_blank">mine</a>. The <a href="http://carsonified.com/" target="_blank">Carsonified</a> team (who were running the events) were also brilliant, and <a href="http://www.red-gate.com/" target="_blank">Red Gate Software</a> and <a href="http://smartbear.com/" target="_blank">Smart Bear Software</a> sponsored the conference (with Red Gate also sponsoring free drinks at a local bar afterwards).</p>
<p>Of course, they were handing out the usual conference crap, but the nice thing was that this was &#8220;crap&#8221; that I actually <em>wanted</em> and so hoarded various bits and pieces:</p>
<p style="text-align: center;"><a href="http://perspx.com/wp-content/uploads/2009/10/freebies1.jpg"><img class="aligncenter size-medium wp-image-865" title="DevDays Freebies" src="http://perspx.com/wp-content/uploads/2009/10/freebies1-300x244.jpg" alt="" width="300" height="244" /></a></p>
<ol>
<li>Red Gate bag and t-shirt</li>
<li>Brochure on FogBugz 7</li>
<li>2 x FogBugz notepads (You can never have too many) and pen</li>
<li>DevDays badge and wristband (wristband == free drinks after)</li>
<li>A bunch of Stack Overflow trilogy stickers, as well as a Coding Horror sticker</li>
<li>A (free!) shrinkwrapped copy of Fog Creek&#8217;s <a href="http://www.projectaardvark.com/movie/" target="_blank">Aardvark&#8217;d</a></li>
</ol>
<p>I was also lucky enough to meet up with and talk to Jeff and Joel, who both signed my MacBook (after Joel proclaiming &#8220;I can&#8217;t sign a Mac!&#8221; and making up by drawing a Windows logo on it)</p>
<p><a href="http://perspx.com/wp-content/uploads/2009/10/signed_macbook.jpg"><img class="aligncenter size-medium wp-image-961" title="Signed Macbook" src="http://perspx.com/wp-content/uploads/2009/10/signed_macbook-300x217.jpg" alt="" width="300" height="217" /></a></p>
<h2>Speakers</h2>
<p>There was an 8 speaker line-up (with Joel speaking twice, or three times including SO Careers) which provided introductory talks on Yahoo! Developer Tools, Principles for System Security, FogBugz, ASP.NET MVC, jQuery, Python and Stack Overflow, as well as an opening keynote from Joel.</p>
<p>The day also started with a funny video put together by Jeff and Joel (which I hope is put up by Joel and Jeff at some point), that included some of the <a href="http://meta.stackoverflow.com/questions/19478/the-many-memes-of-meta" target="_blank">Many Memes of Meta</a>.</p>
<p><em>(Clicking on the thumbnails of the speakers will show the full sized version)</em></p>
<h3>Joel Spolsky: Opening Keynote</h3>
<p><a href="http://perspx.com/wp-content/uploads/2009/10/01-joel-intro2.jpg"><img class="alignleft size-medium wp-image-866" title="Joel Spolsky Opening Keynote" src="http://perspx.com/wp-content/uploads/2009/10/01-joel-intro2-300x225.jpg" alt="" width="300" height="225" /></a>After the intro video, Joel welcomed everyone and  started talking about the dilemma between simplicity and power. His talk was energetic and entertaining, and moved at a good pace. He also had slides, may of which were full of pictures and some which only had one sentence on them (no walls of text) which also made watching more of a pleasure, and emphasised the key parts.</p>
<p>He opened up the talk with some contextual examples of the choice between simplicity and power, referring to a misleading dialog box presented by Outlook, which helped provide an introduction into what he was talking about.</p>
<p>Although not sporting his Union Jack hat (as at London), his talk was littered with English-English words such as &#8220;jam&#8221; (not &#8220;jelly&#8221;), an example using Great British Pounds, the pronunciation of &#8220;beta&#8221; as &#8220;beeta&#8221; and not &#8220;bayta&#8221;, and a correction of amazon.com to amazon.co.uk, as well as various other witty or funny comments.</p>
<h3>Christian Heilmann: Yahoo! Developer Tools</h3>
<p><a href="http://perspx.com/wp-content/uploads/2009/10/02-christian-heilmann2.jpg"><img class="size-medium wp-image-867 alignright" title="Christian Heilmann" src="http://perspx.com/wp-content/uploads/2009/10/02-christian-heilmann2-300x225.jpg" alt="" width="300" height="225" /></a>Christian talked about the Yahoo! Developer Tools, such as the <a href="http://developer.yahoo.com/yui/" target="_blank">YUI Library</a>, <a href="http://developer.yahoo.com/yql/" target="_blank">YQL</a> and <a href="http://developer.yahoo.com/geo/placemaker/" target="_blank">Yahoo! Placemaker</a>. He covered a broad range of the tools in the allotted hour, and although this was sometimes &#8220;bitty&#8221; as he demonstrated parts the tools could do, it worked well for what he was trying to cover, and showed the diverse nature of the Yahoo! Developer Tools.</p>
<p>He also showed a lot of practical examples, including his <a href="http://icant.co.uk/geomaker/" target="_blank">GeoMaker </a>tool which converts websites into maps using the Yahoo! technologies (and has an API providing such output as JSON, HTML and <a href="http://icant.co.uk/geomaker/api.php?url=http://news.yahoo.com&amp;output=lol" target="_blank">LOLCAT</a>), all of which helped with what he was talking about. He also dealt well with a few technical issues well (like the YUI grid layout working slowly) and made a bit of a joke about it</p>
<p>Since he was giving practical examples and talking around them, and not just reeling off a rehearsed speech it also felt like there was better communication and engagement with the audience, rather than just being stuck behind a glass screen. He also made a small digression at one point of <em>&#8220;Everybody who doesn&#8217;t do open-source should be smacked&#8221;</em> and his presentation was generally entertaining.</p>
<h3>Frank Stajano: <em>Seven principles for systems security</em> (<a href="http://www.cl.cam.ac.uk/~fms27/" target="_blank">PDF</a>)</h3>
<p><a href="http://perspx.com/wp-content/uploads/2009/10/03-frank-stajano2.jpg"><img class="alignleft size-medium wp-image-869" title="Frank Stajano" src="http://perspx.com/wp-content/uploads/2009/10/03-frank-stajano2-300x225.jpg" alt="" width="300" height="225" /></a>Frank Stajano is a senior lecturer at Cambridge University, and he talked about systems security. Although what he was talking about was very interesting, I felt that it was more academic than the other talks, and not as &#8220;fun&#8221; at times.</p>
<p>He did relate to the BBC&#8217;s <a href="http://www.bbc.co.uk/programmes/b006m8mf" target="_blank">The Real Hustle</a> to help explain what he was talking about, and showed video clips of staged cons from the show, which were used to illustrate some of his principles (such as deception and the likes) but overall I felt that the presentation was a bit more static, the slides quite wordy and not as energetic as some of the other presentations. I&#8217;m sure well suited to his PhD students but perhaps not as fitting at DevDays.</p>
<h3>Joel Spolsky: FogBugz</h3>
<p><a href="http://perspx.com/wp-content/uploads/2009/10/04-joel-fogbugz11.jpg"><img class="alignright size-medium wp-image-870" title="Joel Spolsky on Fogbugz" src="http://perspx.com/wp-content/uploads/2009/10/04-joel-fogbugz11-300x225.jpg" alt="" width="300" height="225" /></a>Another entertaining presentation from Joel, showing off some of the new features of FogBugz 7 and its integration with Fog Creek&#8217;s new hosted distributed version control system, <a href="http://fogcreek.com/kiln/" target="_blank">Kiln</a>. I thought that it was a good demo because he went through a series of steps to demonstrate the features – creating a new bug case, assigning tasks, reviewing estimated shipping dates, scheduling and making a code review, the stages all followed on from one another which made it easier to follow and was nicer than having the stages as unrelated previews.</p>
<p>Again, he brought his good presentation skills into it and made it entertaining.</p>
<h3>Steven Sanderson: ASP.NET MVC</h3>
<p><a href="http://perspx.com/wp-content/uploads/2009/10/06-steven-sanderson11.jpg"><img class="alignleft size-medium wp-image-871" title="Steven Sanderson on ASP.NET MVC" src="http://perspx.com/wp-content/uploads/2009/10/06-steven-sanderson11-300x225.jpg" alt="" width="300" height="225" /></a>This was one of my favourite, if not overall favourite presentations. Not coming from a .NET background myself, I felt that it was a really well presented introduction presentation. Steven started off by asking for a show of hands of who had used ASP.NET MVC, but then went on to explain what ASP.NET MVC and the MVC design pattern are, before diving into any code, which gave some background for those (like me) who weren&#8217;t familiar with the framework.</p>
<p>He then did a demonstration of various parts of the MVC framework, and coded along the way (although copied and pasted longer code fragments that he had pre-prepared as we &#8220;didn&#8217;t want to see [him] type&#8221;).</p>
<p>His explanations were clear and easy to follow, and his slides were full of images and of a good length. Like Joel&#8217;s demo of FogBugz, it was nice that Steven&#8217;s MVC demo was like a &#8220;journey&#8221;, and not just simply unrelated samples of code. He basically started from scratch and created a simple website demonstrating such features as URL routing (rewriting), form auto-generation (and customisation) and uploading content to the server. He stated at the beginning that he&#8217;d be going through really quickly, but I found it very comprehensible and easy to follow.</p>
<h3>Remy Sharp: jQuery (<a href="http://remysharp.com/talks/#2009_stackoverflow" target="_blank">Download slides</a>)</h3>
<p><a href="http://perspx.com/wp-content/uploads/2009/10/07-remy-sharp2.jpg"><img class="alignright size-medium wp-image-872" title="Remy Sharp on jQuery" src="http://perspx.com/wp-content/uploads/2009/10/07-remy-sharp2-300x225.jpg" alt="" width="300" height="225" /></a>Remy&#8217;s presentation started with an Overview of what he was going to talk about, which I thought was a great way to open, and none of the other presentations had done so explicitly. This created a sense of direction in his presentation, and you could see where it was going.</p>
<p>He started off by demonstrating some of the library features of jQuery, such as the Core functions, Effects, AJAX and Selectors and so on. His slide layout was simple (white background, black text, red text to highlight important parts) which also helped with his presentation, and arrows and red text were used to highlight key points as he explained them.</p>
<p>He also went on to show a live demo of creating a tag cloud from the lists which he was tagged in on Twitter, which he did on-the-fly and was very well done – he came across a few minor problems but fixed them quickly, and went into the afternoon break to finish.</p>
<h3>Michael Foord: Python</h3>
<p><a href="http://perspx.com/wp-content/uploads/2009/10/08-michael-foord11.jpg"><img class="alignleft size-medium wp-image-873" title="Michael Foord" src="http://perspx.com/wp-content/uploads/2009/10/08-michael-foord11-300x225.jpg" alt="" width="300" height="225" /></a>Michael&#8217;s talk was very interesting and almost entirely practical.</p>
<p>He started off by introducing what Python and IronPython were (after getting a show of hands of who had used either before) before providing a live demonstration of Peter Norvig&#8217;s <a href="http://norvig.com/spell-correct.html" target="_blank">Spelling Corrector</a> which Norvig wrote on a plane flight home in less than a page of code; what it does is demonstrate a (much simplified) version of how Google provides spelling correction for searches (i.e. <em>Did you mean x?</em>) and it is written in Python.</p>
<p>Michael explained how the code worked, and fed it into the IronPython interpreter, whilst also demonstrating some features of Python/IronPython such as dictionaries and collection manipulation.</p>
<p>Although the nature of his presentation was such (because he was typing in the code as he explained it) he remained seated for almost the entire presentation which felt a bit static. Also since most of the presentation was an example he didn&#8217;t go into more generic features of Python, which I felt would have made a better introductory presentation.</p>
<p>Michael also showed his book, <em><a href="http://www.ironpythoninaction.com/" target="_blank">IronPython In Action</a></em> whi<em>c</em>h is published by Manning.</p>
<h3>Jeff Atwood: Stack Overflow</h3>
<p>Jeff&#8217;s talk was very funny and entertaining, and referred to many different aspects of Stack Overflow, such as one of the team&#8217;s motto <em>&#8220;Failure is always an option&#8221;</em>, as well as a blog post created by someone who had a bad experience with Stack Overflow, Crap Overflow.</p>
<p>His presentation was full of images (no walls of text) and made it easier to follow and more fun. He was also explaining his passion for what he does as well as the <a href="http://meta.stackoverflow.com/questions/13014/notification-email-from-stackoverflow-contains-3-after-zip-code" target="_blank">love of Stack Overflow for its users</a>. He also explained one of Stack Overflow&#8217;s main goals, to leave a &#8220;trail of breadcrumbs&#8221; for others to see, and also how Stack Overflow can make better writers out of people who ask or answer questions. In short, a well explained, interesting presentation.</p>
<p>I recorded Jeff&#8217;s speech and some questions afterwards, and the 20-minute video can be <a href="http://vimeo.com/7355062" target="_blank">found online</a>.</p>
<h2>Taking away</h2>
<p>I definitely learnt some new stuff whilst at DevDays – I think I&#8217;ll try out jQuery in more detail, and perhaps do something with ASP.NET MVC which looks like a great framework.</p>
<p>I believe that the team have plans to do another set of conferences, perhaps next year, and I&#8217;d definitely recommend any developers to go, as a great way to learn about something new, and also to meet and socialise with other devs.</p>
]]></content:encoded>
			<wfw:commentRss>http://perspx.com/blog/archives/565/devdays-cambridge/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
