<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.1-alpha2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Does Objective-C Really Need Properties?</title>
	<link>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/</link>
	<description>don't you worry about blank, let me worry about blank</description>
	<pubDate>Tue, 06 Jan 2009 10:52:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1-alpha2</generator>

	<item>
		<title>by: Jack</title>
		<link>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-5884</link>
		<pubDate>Tue, 06 Feb 2007 18:57:40 +0000</pubDate>
		<guid>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-5884</guid>
					<description>&lt;EM&gt;It is a language which empowers the desktop software developer to do the work of six C++ engineers&lt;/EM&gt;

I would agree that this is true, but I'm not sure how much of the credit belongs to ObjC and how much belongs to Cocoa. There quite simply is not anything as good for desktop development on any platform as Cocoa - the only thing that comes even close in my mind is gtkmm/gnomemm (C++), and it doesn't have nearly the scope of Cocoa - not to mention the fact that Unix still isn't much of a target for ISV-built desktop software.

(Of course perhaps it is only possible for Cocoa to be so good because it is implemented in ObjC)</description>
		<content:encoded><![CDATA[<p><EM>It is a language which empowers the desktop software developer to do the work of six C++ engineers</EM></p>
<p>I would agree that this is true, but I&#8217;m not sure how much of the credit belongs to ObjC and how much belongs to Cocoa. There quite simply is not anything as good for desktop development on any platform as Cocoa - the only thing that comes even close in my mind is gtkmm/gnomemm (C++), and it doesn&#8217;t have nearly the scope of Cocoa - not to mention the fact that Unix still isn&#8217;t much of a target for ISV-built desktop software.</p>
<p>(Of course perhaps it is only possible for Cocoa to be so good because it is implemented in ObjC)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Tristan O'Tierney</title>
		<link>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-4006</link>
		<pubDate>Tue, 02 Jan 2007 20:33:23 +0000</pubDate>
		<guid>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-4006</guid>
					<description>Heck I didn't think they went far enough with obj-c 2.0.  The property syntax is a very welcomed addition, and I very much like how they took this right from ruby's rule-book.  At WWDC I spoke with one of the obj-c 2 developers and requested they add more dynamic capabilities like ruby's block syntax, and ruby/lisp's functional control structures where blocks like if, and select, can return a value just like any function.  The only thing I can think of that obj-c 2.0 would also benefit from is auto-boxing of primitives for collections.  it would be great if things like  [152 description] where actually possible.</description>
		<content:encoded><![CDATA[<p>Heck I didn&#8217;t think they went far enough with obj-c 2.0.  The property syntax is a very welcomed addition, and I very much like how they took this right from ruby&#8217;s rule-book.  At WWDC I spoke with one of the obj-c 2 developers and requested they add more dynamic capabilities like ruby&#8217;s block syntax, and ruby/lisp&#8217;s functional control structures where blocks like if, and select, can return a value just like any function.  The only thing I can think of that obj-c 2.0 would also benefit from is auto-boxing of primitives for collections.  it would be great if things like  [152 description] where actually possible.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: l0ne</title>
		<link>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3956</link>
		<pubDate>Mon, 01 Jan 2007 21:07:59 +0000</pubDate>
		<guid>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3956</guid>
					<description>mmalc: I was not saying that properties were bad per se; just that having a non-ObjC-ish syntax around was weird and I would have preferred just accessor synthesis (to keep things consistent). I have absolutely NO problem with properties (the opposite is true), just with the syntax choice (and then it's a matter of personal preference, in the end).</description>
		<content:encoded><![CDATA[<p>mmalc: I was not saying that properties were bad per se; just that having a non-ObjC-ish syntax around was weird and I would have preferred just accessor synthesis (to keep things consistent). I have absolutely NO problem with properties (the opposite is true), just with the syntax choice (and then it&#8217;s a matter of personal preference, in the end).
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: mmalc</title>
		<link>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3951</link>
		<pubDate>Mon, 01 Jan 2007 18:36:46 +0000</pubDate>
		<guid>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3951</guid>
					<description>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/


The comments herein assume that the properties feature, and in particular the syntax, follows something akin to that described here: &lt;a href=&quot;http://www.informit.com/articles/article.asp?p=665128&amp;#38;seqNum=3&amp;#38;rl=1&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.


It's difficult to know where to start to critique such an ill-informed and misrepresentative diatribe.  To take on a couple of aspects:

&lt;blockquote cite=&quot;&quot;&gt;
No, synthesized accessors and setters are cool, properties are not.
&lt;/blockquote&gt;
This suggests a fundamental misunderstanding of the technology.  Synthesised getters and setters are a primary feature of properties.  The quoted sentence thus simply doesn't make sense.

&lt;blockquote cite=&quot;&quot;&gt;
Accessing the property goes through KVC,
&lt;/blockquote&gt;

It's not clear why you make that assertion.  If as appears to be the case you intend to imply that
&lt;code&gt;anObject.property&lt;/code&gt;
is compiled to become
&lt;code&gt;[anObject valueForKey:@&quot;property&quot;];&lt;/code&gt;
then perhaps you could provide some evidence to show why you believe this to be true?
Fundamentally, however, properties and key-value coding are orthogonal technologies.

To address a comment from l0ne:
&lt;blockquote cite=&quot;&quot;&gt;
I agree that this sucks. Having -ivar and -setIvar: would have been better. Maybe there are folks at Apple who are tired of all those “[” and “]”s?
&lt;/blockquote&gt;

This again simply doesn't make sense.  Using properties, you're still free to use -ivar and -setIvar if you choose.


To return to the original text, the biggest irony comes right at the end:
&lt;blockquote cite=&quot;&quot;&gt;
explicit is better than implicit
So, where do Objective-C properties fit in?
&lt;/blockquote&gt;

A significant aspect of the properties feature is precisely that it makes information explicit.  By looking at a &lt;b&gt;header&lt;/b&gt; file you will quickly be able to tell that a particular instance variable is considered a property of an object, that assigned values are copied as opposed to retained,and so on.

Properties supports a much more declarative style of programming.  The intent is made explicit.  This is of benefit not just to the originator of the code (who reaps the benefit of a considerable reduction in code size) but also of the consumer who can see immediately the properties that a class has and in turn what attributes and behaviours those properties themselves have.


Stepping back, your primary objection to properties seems really to be with the dot syntax, not the feature itself.  If that's the case, then you're perfectly free to continue using square brackets whilst still leveraging the other conveniences the feature provides.</description>
		<content:encoded><![CDATA[<p><a href='http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/' rel='nofollow'>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/</a></p>
<p>The comments herein assume that the properties feature, and in particular the syntax, follows something akin to that described here: <a href="http://www.informit.com/articles/article.asp?p=665128&amp;seqNum=3&amp;rl=1" rel="nofollow">here</a>.</p>
<p>It&#8217;s difficult to know where to start to critique such an ill-informed and misrepresentative diatribe.  To take on a couple of aspects:</p>
<blockquote cite=""><p>
No, synthesized accessors and setters are cool, properties are not.
</p></blockquote>
<p>This suggests a fundamental misunderstanding of the technology.  Synthesised getters and setters are a primary feature of properties.  The quoted sentence thus simply doesn&#8217;t make sense.</p>
<blockquote cite=""><p>
Accessing the property goes through KVC,
</p></blockquote>
<p>It&#8217;s not clear why you make that assertion.  If as appears to be the case you intend to imply that<br />
<code>anObject.property</code><br />
is compiled to become<br />
<code>[anObject valueForKey:@"property"];</code><br />
then perhaps you could provide some evidence to show why you believe this to be true?<br />
Fundamentally, however, properties and key-value coding are orthogonal technologies.</p>
<p>To address a comment from l0ne:</p>
<blockquote cite=""><p>
I agree that this sucks. Having -ivar and -setIvar: would have been better. Maybe there are folks at Apple who are tired of all those “[” and “]”s?
</p></blockquote>
<p>This again simply doesn&#8217;t make sense.  Using properties, you&#8217;re still free to use -ivar and -setIvar if you choose.</p>
<p>To return to the original text, the biggest irony comes right at the end:</p>
<blockquote cite=""><p>
explicit is better than implicit<br />
So, where do Objective-C properties fit in?
</p></blockquote>
<p>A significant aspect of the properties feature is precisely that it makes information explicit.  By looking at a <b>header</b> file you will quickly be able to tell that a particular instance variable is considered a property of an object, that assigned values are copied as opposed to retained,and so on.</p>
<p>Properties supports a much more declarative style of programming.  The intent is made explicit.  This is of benefit not just to the originator of the code (who reaps the benefit of a considerable reduction in code size) but also of the consumer who can see immediately the properties that a class has and in turn what attributes and behaviours those properties themselves have.</p>
<p>Stepping back, your primary objection to properties seems really to be with the dot syntax, not the feature itself.  If that&#8217;s the case, then you&#8217;re perfectly free to continue using square brackets whilst still leveraging the other conveniences the feature provides.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Scott Stevenson</title>
		<link>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3946</link>
		<pubDate>Mon, 01 Jan 2007 17:08:02 +0000</pubDate>
		<guid>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3946</guid>
					<description>After re-reading this now, I'm not as sure I understand what you're advocating. Is it fair to say the only thing you don't like is the dot syntax? Also, I'm not sure what you mean by this:

&lt;blockquote&gt;There’s also that object.property is moving away from Objective-C’s Smalltalk roots. We’re thinking about things as data structures rather than live objects which respond to messages.&lt;/blockquote&gt;

Cocoa has used key paths for a long time, and they took on a more prominent role in Cocoa Bindings and Core Data. Maybe dots suggest data structures by C conventions, but I think Cocoa programmers are smart enough to learn that they can mean messages in Objective-C 2.0.</description>
		<content:encoded><![CDATA[<p>After re-reading this now, I&#8217;m not as sure I understand what you&#8217;re advocating. Is it fair to say the only thing you don&#8217;t like is the dot syntax? Also, I&#8217;m not sure what you mean by this:</p>
<blockquote><p>There’s also that object.property is moving away from Objective-C’s Smalltalk roots. We’re thinking about things as data structures rather than live objects which respond to messages.</p></blockquote>
<p>Cocoa has used key paths for a long time, and they took on a more prominent role in Cocoa Bindings and Core Data. Maybe dots suggest data structures by C conventions, but I think Cocoa programmers are smart enough to learn that they can mean messages in Objective-C 2.0.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Michael Stroeck</title>
		<link>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3681</link>
		<pubDate>Wed, 27 Dec 2006 10:45:36 +0000</pubDate>
		<guid>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3681</guid>
					<description>Let's all file a bug report to Apple: &quot;XCode needs different highlight colors for C structs and ObjC 2 properties.&quot;

Go. File it now.</description>
		<content:encoded><![CDATA[<p>Let&#8217;s all file a bug report to Apple: &#8220;XCode needs different highlight colors for C structs and ObjC 2 properties.&#8221;</p>
<p>Go. File it now.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jeremyah</title>
		<link>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3250</link>
		<pubDate>Mon, 18 Dec 2006 08:29:35 +0000</pubDate>
		<guid>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3250</guid>
					<description>I Like properties but I like the message style syntax better.  Kinda like [object property] vs object.property .  It seems more obj-c that way and less (c++, java, c#) ish</description>
		<content:encoded><![CDATA[<p>I Like properties but I like the message style syntax better.  Kinda like [object property] vs object.property .  It seems more obj-c that way and less (c++, java, c#) ish
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Ryan Miglavs</title>
		<link>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3238</link>
		<pubDate>Mon, 18 Dec 2006 02:28:31 +0000</pubDate>
		<guid>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3238</guid>
					<description>Wow, refreshing to read this. One of my coder buddies came back from WWDC raving about this, and I'll admit I was kind of bothered by the whole idea. I mean, I came from programming in C, Java, BASIC (barf!), and Python. Using all those weird Smalltalk-style method calls seemed weird at first, and then I started absolutely loving every bit of it. The messages and the whole approach just makes sense.

And I love the quirk of it, too.

The advantages of using proper old-school accessor methods are as you mention them, and there is little reason for properties to exist, but for me it just feels better to use the Smalltalk-style format.</description>
		<content:encoded><![CDATA[<p>Wow, refreshing to read this. One of my coder buddies came back from WWDC raving about this, and I&#8217;ll admit I was kind of bothered by the whole idea. I mean, I came from programming in C, Java, BASIC (barf!), and Python. Using all those weird Smalltalk-style method calls seemed weird at first, and then I started absolutely loving every bit of it. The messages and the whole approach just makes sense.</p>
<p>And I love the quirk of it, too.</p>
<p>The advantages of using proper old-school accessor methods are as you mention them, and there is little reason for properties to exist, but for me it just feels better to use the Smalltalk-style format.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: l0ne</title>
		<link>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3016</link>
		<pubDate>Wed, 13 Dec 2006 14:31:14 +0000</pubDate>
		<guid>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-3016</guid>
					<description>The syntax choice is mostly laziness.
The GCC parser knows how to parse identifier followed by . followed by identifier. It also can identify the first identifier as a variable of some type. If it's a pointer and it were regular C, pointer.field would be pointless and trigger an error. They've probably removed the code path that would generate this kind of error and changed it with their KVC code.

At least, this sounds much like what I'd do. :)

I agree that this sucks. Having -ivar and -setIvar: would have been better. Maybe there are folks at Apple who are tired of all those &quot;[&quot; and &quot;]&quot;s?</description>
		<content:encoded><![CDATA[<p>The syntax choice is mostly laziness.<br />
The GCC parser knows how to parse identifier followed by . followed by identifier. It also can identify the first identifier as a variable of some type. If it&#8217;s a pointer and it were regular C, pointer.field would be pointless and trigger an error. They&#8217;ve probably removed the code path that would generate this kind of error and changed it with their KVC code.</p>
<p>At least, this sounds much like what I&#8217;d do. <img src='http://www.stuffonfire.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I agree that this sucks. Having -ivar and -setIvar: would have been better. Maybe there are folks at Apple who are tired of all those &#8220;[&#8221; and &#8220;]&#8221;s?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: aure</title>
		<link>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-2965</link>
		<pubDate>Tue, 12 Dec 2006 14:03:06 +0000</pubDate>
		<guid>http://www.stuffonfire.com/2006/12/08/does-objective-c-really-need-properties/#comment-2965</guid>
					<description>I think the syntax choice is a catastrophy

x.y refers to a C struct field, nothing else.

now i'll spend my time looking at the header file to determine if x is a struct or an object...
thanks apple.</description>
		<content:encoded><![CDATA[<p>I think the syntax choice is a catastrophy</p>
<p>x.y refers to a C struct field, nothing else.</p>
<p>now i&#8217;ll spend my time looking at the header file to determine if x is a struct or an object&#8230;<br />
thanks apple.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
