<?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>Tom Dalling &#187; Coding Tips</title>
	<atom:link href="http://www.tomdalling.com/blog/category/coding-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tomdalling.com/blog</link>
	<description>Thoughts of a software developer</description>
	<lastBuildDate>Thu, 17 May 2012 08:35:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>When A Café Is Not A Café – A Short Lesson In Unicode Featuring NSString</title>
		<link>http://www.tomdalling.com/blog/coding-tips/when-a-cafe-is-not-a-cafe-a-short-lesson-in-unicode-featuring-nsstring</link>
		<comments>http://www.tomdalling.com/blog/coding-tips/when-a-cafe-is-not-a-cafe-a-short-lesson-in-unicode-featuring-nsstring#comments</comments>
		<pubDate>Thu, 08 Mar 2012 10:38:31 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding Tips]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/blog/?p=576</guid>
		<description><![CDATA[Let&#8217;s start with two exotic strings (console output is in the code comments): NSString* apples = NSGetFrenchWord&#40;&#41;; NSString* oranges = NSGetFrenchWord&#40;&#41;; &#160; NSLog&#40;@&#34;apples == '%@'&#34;, apples&#41;; //apples == 'café' NSLog&#40;@&#34;oranges == '%@'&#34;, oranges&#41;; //oranges == 'café' They look identical, but looks can be deceiving. NSLog&#40;@&#34;isEqual? %@&#34;, &#91;apples isEqual:oranges&#93; ? @&#34;YES&#34; : @&#34;NO&#34;&#41;; //isEqual? NO NSLog&#40;@&#34;[apples length] [...]]]></description>
		<wfw:commentRss>http://www.tomdalling.com/blog/coding-tips/when-a-cafe-is-not-a-cafe-a-short-lesson-in-unicode-featuring-nsstring/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Const Correctness For NSString (And Pointers In General)</title>
		<link>http://www.tomdalling.com/blog/coding-tips/const-correctness-for-nsstring-and-pointers-in-general</link>
		<comments>http://www.tomdalling.com/blog/coding-tips/const-correctness-for-nsstring-and-pointers-in-general#comments</comments>
		<pubDate>Fri, 16 Dec 2011 01:38:00 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding Tips]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/blog/?p=552</guid>
		<description><![CDATA[So you&#8217;re implementing a new notification and you want the name to be a constant. Easy, right? const NSString* VTMyNewNotification; If that&#8217;s how you do constants, you&#8217;re not doing it quite right. Try assign a new value to the alleged constant and watch in horror as the compiler doesn&#8217;t stop you. This is because when [...]]]></description>
		<wfw:commentRss>http://www.tomdalling.com/blog/coding-tips/const-correctness-for-nsstring-and-pointers-in-general/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding Tip: Replace Complicated Conditions With Boolean Variables</title>
		<link>http://www.tomdalling.com/blog/coding-tips/coding-tip-replace-complicated-conditions-with-boolean-variables</link>
		<comments>http://www.tomdalling.com/blog/coding-tips/coding-tip-replace-complicated-conditions-with-boolean-variables#comments</comments>
		<pubDate>Sat, 03 Oct 2009 09:02:27 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Coding Tips]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=196</guid>
		<description><![CDATA[Consider the following if statement: if&#40;dragOperation != NSDragOperationCopy &#38;&#38; NSPointInRect&#40;currentMouseLocation, self.bounds&#41;&#41;&#123; //do something &#125; Even though you may have worked out what the condition represents, it probably took you a little longer than it should. It&#8217;s complicated, making it time consuming to read, and prone to bugs upon modification. Thankfully, there is an easy remedy: [...]]]></description>
		<wfw:commentRss>http://www.tomdalling.com/blog/coding-tips/coding-tip-replace-complicated-conditions-with-boolean-variables/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding Tip: Use The Ternary Conditional Operator</title>
		<link>http://www.tomdalling.com/blog/coding-tips/coding-tip-use-the-ternary-conditional-operator</link>
		<comments>http://www.tomdalling.com/blog/coding-tips/coding-tip-use-the-ternary-conditional-operator#comments</comments>
		<pubDate>Wed, 09 Sep 2009 06:01:24 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Coding Tips]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=152</guid>
		<description><![CDATA[The ternary conditional operator (?:) can be used as a short-hand version of an if statement. It is a feature of many languages. For example, this code: int height; if&#40;isTall&#41; height = 50; else height = 10; can be better written as: int height = isTall ? 50 : 10; The ?: operator is good [...]]]></description>
		<wfw:commentRss>http://www.tomdalling.com/blog/coding-tips/coding-tip-use-the-ternary-conditional-operator/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding Tip: Don&#8217;t Mix Abstraction Levels</title>
		<link>http://www.tomdalling.com/blog/coding-tips/coding-tip-dont-mix-abstraction-levels</link>
		<comments>http://www.tomdalling.com/blog/coding-tips/coding-tip-dont-mix-abstraction-levels#comments</comments>
		<pubDate>Sun, 05 Jul 2009 05:57:08 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Coding Tips]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=81</guid>
		<description><![CDATA[Can you tell what is wrong with the abstraction in this class interface? @interface EmployeeList -&#40;void&#41; addObject:&#40;Employee*&#41;anEmployee; -&#40;void&#41; removeObject:&#40;Employee*&#41;anEmployee; -&#40;NSUInteger&#41; numberOfEmployees; @end Here is the answer: &#8220;addObject&#8221; and &#8220;removeObject&#8221; should be named &#8220;addEmployee&#8221; and &#8220;removeEmployee&#8221; Why? Because EmployeeList is at a higher level of abstraction than a generic list class. addObject and removeObject are at [...]]]></description>
		<wfw:commentRss>http://www.tomdalling.com/blog/coding-tips/coding-tip-dont-mix-abstraction-levels/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding Tip: Have A Single Exit Point</title>
		<link>http://www.tomdalling.com/blog/coding-tips/coding-tip-have-a-single-exit-point</link>
		<comments>http://www.tomdalling.com/blog/coding-tips/coding-tip-have-a-single-exit-point#comments</comments>
		<pubDate>Tue, 30 Jun 2009 10:19:30 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Coding Tips]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=75</guid>
		<description><![CDATA[Having one exit point (return) from a function is a good thing. Here is an example of a single exit point: int MyArray::indexOfElement&#40;int elementToFind&#41;&#123; int foundIndex = ELEMENT_NOT_FOUND; &#160; for&#40;int i = 0; i &#60; m_numberOfElements; ++i&#41;&#123; if&#40;this-&#62;elementAtIndex&#40;i&#41; == elementToFind&#41;&#123; foundIndex = i; break; &#125; &#125; &#160; return foundIndex; &#125; Having multiple exit points can [...]]]></description>
		<wfw:commentRss>http://www.tomdalling.com/blog/coding-tips/coding-tip-have-a-single-exit-point/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

