<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Bracket-notation syntax</title>
	<atom:link href="http://www.benzado.com/blog/post/270/bracket-notation-syntax/feed" rel="self" type="application/rss+xml" />
	<link>http://www.benzado.com/blog/post/270/bracket-notation-syntax</link>
	<description>A professional&#039;s personal blog.</description>
	<lastBuildDate>Sun, 30 Jan 2011 01:28:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: Benjamin</title>
		<link>http://www.benzado.com/blog/post/270/bracket-notation-syntax/comment-page-1#comment-335</link>
		<dc:creator>Benjamin</dc:creator>
		<pubDate>Thu, 10 Sep 2009 20:35:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.benzado.com/blog/?p=270#comment-335</guid>
		<description>I agree that operator overloading is objectively terrible.</description>
		<content:encoded><![CDATA[<p>I agree that operator overloading is objectively terrible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Dovey</title>
		<link>http://www.benzado.com/blog/post/270/bracket-notation-syntax/comment-page-1#comment-334</link>
		<dc:creator>Jim Dovey</dc:creator>
		<pubDate>Thu, 10 Sep 2009 20:08:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.benzado.com/blog/?p=270#comment-334</guid>
		<description>I&#039;d add a little something to the preceding paragraph in Benjamin&#039;s last comment: &quot;x = y + z&quot; could be all sorts of different things. In C or Objective-C the possibilities are as listed above. In C++ (or Objective-C++) the possibilities are much larger, since any one of those could be a C++ object, any of which could have overridden = or + to perform different operations. In C++, you even get to implement different versions of those for different types.

I&#039;ve seen plenty of C++ code where something went wrong because a compiler did something behind-the-scenes which resulted in a different operator method being called, and often the type error messages wouldn&#039;t help at all. At least in ObjC with property syntax, the compiler can look at the property itself and point the user back to the property declaration. It can also enforce things like &#039;readonly&#039; properties where a writer is defined inside the class for its own internal use— &#039;[foo setValue: x]&#039; would work, since -setValue: exists, but &#039;foo.value = x&#039; would fail because the property is declared as readonly.</description>
		<content:encoded><![CDATA[<p>I&#8217;d add a little something to the preceding paragraph in Benjamin&#8217;s last comment: &#8220;x = y + z&#8221; could be all sorts of different things. In C or Objective-C the possibilities are as listed above. In C++ (or Objective-C++) the possibilities are much larger, since any one of those could be a C++ object, any of which could have overridden = or + to perform different operations. In C++, you even get to implement different versions of those for different types.</p>
<p>I&#8217;ve seen plenty of C++ code where something went wrong because a compiler did something behind-the-scenes which resulted in a different operator method being called, and often the type error messages wouldn&#8217;t help at all. At least in ObjC with property syntax, the compiler can look at the property itself and point the user back to the property declaration. It can also enforce things like &#8216;readonly&#8217; properties where a writer is defined inside the class for its own internal use— &#8216;[foo setValue: x]&#8216; would work, since -setValue: exists, but &#8216;foo.value = x&#8217; would fail because the property is declared as readonly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benjamin</title>
		<link>http://www.benzado.com/blog/post/270/bracket-notation-syntax/comment-page-1#comment-325</link>
		<dc:creator>Benjamin</dc:creator>
		<pubDate>Mon, 10 Aug 2009 05:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.benzado.com/blog/?p=270#comment-325</guid>
		<description>My problem is with appeals to &quot;readability&quot; that are arbitrary and ridiculous. Dot notation is unambiguous if you know the type of the variable preceding the dot. More importantly, if used correctly the &lt;em&gt;intention&lt;/em&gt; of foo.value is pretty much the same whether foo is an object or a struct.

The arguments basically state that &quot;foo.value&quot; is confusing because, &lt;em&gt;without context&lt;/em&gt;, you don&#039;t know what it might compile to. That&#039;s a useless metric, because nobody ever needs to evaluate a line of code without any context.

It&#039;s about as valuable as arguing that &quot;x = y + z&quot; is confusing because you don&#039;t know what machine instructions it will compile to, since x, y, or z could be any mix of char, int, float, long, double, long long, etc.

So, I&#039;m not saying that opponents of dot notation are Luddites. I&#039;m saying they are misguided. They are setting arbitrary boundaries for what&#039;s &quot;confusing&quot; based on useless measures of &quot;readability.&quot;</description>
		<content:encoded><![CDATA[<p>My problem is with appeals to &#8220;readability&#8221; that are arbitrary and ridiculous. Dot notation is unambiguous if you know the type of the variable preceding the dot. More importantly, if used correctly the <em>intention</em> of foo.value is pretty much the same whether foo is an object or a struct.</p>
<p>The arguments basically state that &#8220;foo.value&#8221; is confusing because, <em>without context</em>, you don&#8217;t know what it might compile to. That&#8217;s a useless metric, because nobody ever needs to evaluate a line of code without any context.</p>
<p>It&#8217;s about as valuable as arguing that &#8220;x = y + z&#8221; is confusing because you don&#8217;t know what machine instructions it will compile to, since x, y, or z could be any mix of char, int, float, long, double, long long, etc.</p>
<p>So, I&#8217;m not saying that opponents of dot notation are Luddites. I&#8217;m saying they are misguided. They are setting arbitrary boundaries for what&#8217;s &#8220;confusing&#8221; based on useless measures of &#8220;readability.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Jalkut</title>
		<link>http://www.benzado.com/blog/post/270/bracket-notation-syntax/comment-page-1#comment-324</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Sun, 09 Aug 2009 04:38:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.benzado.com/blog/?p=270#comment-324</guid>
		<description>(Meant to say &quot;We&#039;re NOT up in arms about blocks, for instance.&quot;)</description>
		<content:encoded><![CDATA[<p>(Meant to say &#8220;We&#8217;re NOT up in arms about blocks, for instance.&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Jalkut</title>
		<link>http://www.benzado.com/blog/post/270/bracket-notation-syntax/comment-page-1#comment-323</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Sun, 09 Aug 2009 04:37:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.benzado.com/blog/?p=270#comment-323</guid>
		<description>The nice thing about brackets in ObjC, is they are used in such an obviously distinct and unique manner from &quot;vanilla C&quot;, that there&#039;s never any misunderstanding about what they mean.

In my opinion the only real reason dot notation in ObjC2 gets the push-back that it does is because it hijacks a notation that can be easily confused with the common C-language notation for a struct element offset.

So, if you want to argue for dot notation, argue on its merits. I don&#039;t think your implication, that opponents of dot notation are merely luddites, is true.  

We&#039;re up-in-arms about blocks, for instance.  The use of the ^ notation for blocks is handled in a way that makes it very unlikely to get an ambiguous reading of the programmer&#039;s intention.

I think that the dot notation syntax was simply a mistake. I don&#039;t fault the designers, it&#039;s hard to come up with something that will stand the test of programmers, and how they actually work with the language. But hindsight is 20/20 and to me the dot notation&#039;s problems outweigh its benefits.</description>
		<content:encoded><![CDATA[<p>The nice thing about brackets in ObjC, is they are used in such an obviously distinct and unique manner from &#8220;vanilla C&#8221;, that there&#8217;s never any misunderstanding about what they mean.</p>
<p>In my opinion the only real reason dot notation in ObjC2 gets the push-back that it does is because it hijacks a notation that can be easily confused with the common C-language notation for a struct element offset.</p>
<p>So, if you want to argue for dot notation, argue on its merits. I don&#8217;t think your implication, that opponents of dot notation are merely luddites, is true.  </p>
<p>We&#8217;re up-in-arms about blocks, for instance.  The use of the ^ notation for blocks is handled in a way that makes it very unlikely to get an ambiguous reading of the programmer&#8217;s intention.</p>
<p>I think that the dot notation syntax was simply a mistake. I don&#8217;t fault the designers, it&#8217;s hard to come up with something that will stand the test of programmers, and how they actually work with the language. But hindsight is 20/20 and to me the dot notation&#8217;s problems outweigh its benefits.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Served from: www.benzado.com @ 2012-02-10 16:31:33 by W3 Total Cache -->
