<?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"
	>
<channel>
	<title>Comments for Groby's Coding Adventures</title>
	<atom:link href="http://www.codingadventures.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codingadventures.com</link>
	<description>Captain's log</description>
	<pubDate>Thu, 20 Nov 2008 13:22:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>Comment on Learning Cocoa - Book Recommendations by steven</title>
		<link>http://www.codingadventures.com/2008/07/learning-cocoa-book-recommendations/#comment-17</link>
		<dc:creator>steven</dc:creator>
		<pubDate>Wed, 09 Jul 2008 17:45:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.codingadventures.com/?p=23#comment-17</guid>
		<description>&lt;p&gt;Awesome. Bookmarked. Thanks, Groby.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Awesome. Bookmarked. Thanks, Groby.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Threshold Filter in GLSL by Patrick Geiller</title>
		<link>http://www.codingadventures.com/2008/06/threshold-filter-in-glsl/#comment-16</link>
		<dc:creator>Patrick Geiller</dc:creator>
		<pubDate>Wed, 02 Jul 2008 18:07:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.codingadventures.com/?p=22#comment-16</guid>
		<description>&lt;p&gt;You can also use the ternary operator directly :&lt;/p&gt;

&lt;p&gt;pixel.a = someValue &#62; 4.5 ? 1.0 : 0.5;
pixel.a = someValue &#62; 4.5 ? (someValue &#62; 6.0 ? 1.0 : 0.7)  : 0.5;&lt;/p&gt;

&lt;p&gt;Good luck with your shaders ! I've found the Apple Documentation to be quite lacking, I'm still looking for a list of all available functions.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You can also use the ternary operator directly :</p>

<p>pixel.a = someValue &gt; 4.5 ? 1.0 : 0.5;
pixel.a = someValue &gt; 4.5 ? (someValue &gt; 6.0 ? 1.0 : 0.7)  : 0.5;</p>

<p>Good luck with your shaders ! I&#8217;ve found the Apple Documentation to be quite lacking, I&#8217;m still looking for a list of all available functions.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reason #947 why C++ is dangerous - and certainly not type-safe by Patrick Geiller</title>
		<link>http://www.codingadventures.com/2008/04/reason-947-why-c-is-dangerous-and-certainly-not-type-safe/#comment-15</link>
		<dc:creator>Patrick Geiller</dc:creator>
		<pubDate>Wed, 02 Jul 2008 17:52:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.codingadventures.com/?p=14#comment-15</guid>
		<description>&lt;p&gt;There is some direct initiliazation code in Quake, stuff like Vector = {0, 0, 1}. Vector is defined as float[3], though.&lt;/p&gt;

&lt;p&gt;As for the comma operator, one use in Javascript :&lt;/p&gt;

&lt;p&gt;function doStuffWithNode(node)
{
  if (someInvalidCondition) return Warning('invalid node'), null
}&lt;/p&gt;

&lt;p&gt;This would call the log code then return null. I really prefer that to opening up braces and using 4 lines to log then return.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>There is some direct initiliazation code in Quake, stuff like Vector = {0, 0, 1}. Vector is defined as float[3], though.</p>

<p>As for the comma operator, one use in Javascript :</p>

<p>function doStuffWithNode(node)
{
  if (someInvalidCondition) return Warning(&#8217;invalid node&#8217;), null
}</p>

<p>This would call the log code then return null. I really prefer that to opening up braces and using 4 lines to log then return.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reason #947 why C++ is dangerous - and certainly not type-safe by Groby</title>
		<link>http://www.codingadventures.com/2008/04/reason-947-why-c-is-dangerous-and-certainly-not-type-safe/#comment-14</link>
		<dc:creator>Groby</dc:creator>
		<pubDate>Mon, 09 Jun 2008 03:50:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.codingadventures.com/?p=14#comment-14</guid>
		<description>&lt;p&gt;Tom: OK, that &lt;em&gt;is&lt;/em&gt; a fairly common case. I'd argue it's unnecessary, but that's mostly a stylistic question, so let's not even go there...&lt;/p&gt;

&lt;p&gt;Michael: I'm a bit disappointed the first flame I got on this blog was &lt;em&gt;that&lt;/em&gt; weak. Ah, where are the good old days of comp.lang.c++ where people knew how to flame ;)&lt;/p&gt;

&lt;p&gt;And the most frustrating bit of C++ are not even the possibility of subtle errors - compile times are horrenduous. (Expect to see a few more articles on that)&lt;/p&gt;

&lt;p&gt;In general: in case anybody thinks this is my &lt;em&gt;only&lt;/em&gt; beef with C++ - it's reason #947, as I said. It's just the one thing that caused me to vent.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Tom: OK, that <em>is</em> a fairly common case. I&#8217;d argue it&#8217;s unnecessary, but that&#8217;s mostly a stylistic question, so let&#8217;s not even go there&#8230;</p>

<p>Michael: I&#8217;m a bit disappointed the first flame I got on this blog was <em>that</em> weak. Ah, where are the good old days of comp.lang.c++ where people knew how to flame <img src='http://www.codingadventures.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<p>And the most frustrating bit of C++ are not even the possibility of subtle errors - compile times are horrenduous. (Expect to see a few more articles on that)</p>

<p>In general: in case anybody thinks this is my <em>only</em> beef with C++ - it&#8217;s reason #947, as I said. It&#8217;s just the one thing that caused me to vent.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reason #947 why C++ is dangerous - and certainly not type-safe by Michael Mrozek</title>
		<link>http://www.codingadventures.com/2008/04/reason-947-why-c-is-dangerous-and-certainly-not-type-safe/#comment-13</link>
		<dc:creator>Michael Mrozek</dc:creator>
		<pubDate>Mon, 09 Jun 2008 01:14:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.codingadventures.com/?p=14#comment-13</guid>
		<description>&lt;p&gt;From now on I will be insulting people with "You are an ignorant" :D. And while the example does seem silly since the assignment operator is being misused, I agree that C++ is very prone to subtle errors, which can be frustrating at times.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>From now on I will be insulting people with &#8220;You are an ignorant&#8221; :D. And while the example does seem silly since the assignment operator is being misused, I agree that C++ is very prone to subtle errors, which can be frustrating at times.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reason #947 why C++ is dangerous - and certainly not type-safe by Tom Ritchford</title>
		<link>http://www.codingadventures.com/2008/04/reason-947-why-c-is-dangerous-and-certainly-not-type-safe/#comment-12</link>
		<dc:creator>Tom Ritchford</dc:creator>
		<pubDate>Mon, 09 Jun 2008 00:34:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.codingadventures.com/?p=14#comment-12</guid>
		<description>&lt;p&gt;"I’ve never seen a case where the comma operator actually was the intent of the programmer and useful in any way except to obfuscate the code."&lt;/p&gt;

&lt;p&gt;What about this super-common idiom:&lt;/p&gt;

&lt;p&gt;for (int i = 0, size = v-&#62;size(); i &#60; size; ++i)&lt;/p&gt;

&lt;p&gt;?&lt;/p&gt;

&lt;p&gt;(you might not want to use an iterator, perhaps because you want the index as well as the value...)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&#8220;I’ve never seen a case where the comma operator actually was the intent of the programmer and useful in any way except to obfuscate the code.&#8221;</p>

<p>What about this super-common idiom:</p>

<p>for (int i = 0, size = v-&gt;size(); i &lt; size; ++i)</p>

<p>?</p>

<p>(you might not want to use an iterator, perhaps because you want the index as well as the value&#8230;)</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reason #947 why C++ is dangerous - and certainly not type-safe by Groby</title>
		<link>http://www.codingadventures.com/2008/04/reason-947-why-c-is-dangerous-and-certainly-not-type-safe/#comment-11</link>
		<dc:creator>Groby</dc:creator>
		<pubDate>Sun, 08 Jun 2008 03:29:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.codingadventures.com/?p=14#comment-11</guid>
		<description>&lt;p&gt;Steve: This is a real example, yes. It's not due to the fact that I waited too long with the ARM (I read it the first time in 92, I think). It's simply due to the fact that in the environment I work in (Video games) many low level data structures are just that, plain structures. Ergo, no constructor available. It doesn't help that every game team I've ever seen implements their own Vector class, with slightly different semantics ;)&lt;/p&gt;

&lt;p&gt;And my complaint isn't that C++ doesn't accomodate this. I'd be perfectly happy with a syntax error. My complaint is that by accidentally typing something that's &lt;em&gt;clearly&lt;/em&gt; not valid code, all the "magic" imbued in C++ generates working code that's not even close to what I intended.&lt;/p&gt;

&lt;p&gt;The main complaint: explicit constructors are safer than implicit ones - they should be the default. (Immediately followed by the comma operator)&lt;/p&gt;

&lt;p&gt;Mark: See above - we've got plenty of PODs, so the initialization code is unfortunately a valid choice. (There are also plenty of constructors. But as long as I'd get an error if I picked the wrong one, I'd be happy)&lt;/p&gt;

&lt;p&gt;Dumb: Always glad to see a well-reasoned argument.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Steve: This is a real example, yes. It&#8217;s not due to the fact that I waited too long with the ARM (I read it the first time in 92, I think). It&#8217;s simply due to the fact that in the environment I work in (Video games) many low level data structures are just that, plain structures. Ergo, no constructor available. It doesn&#8217;t help that every game team I&#8217;ve ever seen implements their own Vector class, with slightly different semantics <img src='http://www.codingadventures.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<p>And my complaint isn&#8217;t that C++ doesn&#8217;t accomodate this. I&#8217;d be perfectly happy with a syntax error. My complaint is that by accidentally typing something that&#8217;s <em>clearly</em> not valid code, all the &#8220;magic&#8221; imbued in C++ generates working code that&#8217;s not even close to what I intended.</p>

<p>The main complaint: explicit constructors are safer than implicit ones - they should be the default. (Immediately followed by the comma operator)</p>

<p>Mark: See above - we&#8217;ve got plenty of PODs, so the initialization code is unfortunately a valid choice. (There are also plenty of constructors. But as long as I&#8217;d get an error if I picked the wrong one, I&#8217;d be happy)</p>

<p>Dumb: Always glad to see a well-reasoned argument.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reason #947 why C++ is dangerous - and certainly not type-safe by stevej</title>
		<link>http://www.codingadventures.com/2008/04/reason-947-why-c-is-dangerous-and-certainly-not-type-safe/#comment-10</link>
		<dc:creator>stevej</dc:creator>
		<pubDate>Sun, 08 Jun 2008 01:01:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.codingadventures.com/?p=14#comment-10</guid>
		<description>&lt;p&gt;I agree, this is surprising. Is it a boiled down example, or did you actually write this line of code (hoping for a vector so initialized)?&lt;/p&gt;

&lt;p&gt;If the latter case, then perhaps you waited too long to read the ARM. This is in an uncommon usage/style/attempt (in C++), I think.&lt;/p&gt;

&lt;p&gt;No language that I've used accomodates every means of expression. Most (even C++) clobber you with a syntax error. Generally.&lt;/p&gt;

&lt;p&gt;Yeah, you got bit here. Try to be nice.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I agree, this is surprising. Is it a boiled down example, or did you actually write this line of code (hoping for a vector so initialized)?</p>

<p>If the latter case, then perhaps you waited too long to read the ARM. This is in an uncommon usage/style/attempt (in C++), I think.</p>

<p>No language that I&#8217;ve used accomodates every means of expression. Most (even C++) clobber you with a syntax error. Generally.</p>

<p>Yeah, you got bit here. Try to be nice.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reason #947 why C++ is dangerous - and certainly not type-safe by dumb</title>
		<link>http://www.codingadventures.com/2008/04/reason-947-why-c-is-dangerous-and-certainly-not-type-safe/#comment-9</link>
		<dc:creator>dumb</dc:creator>
		<pubDate>Sat, 07 Jun 2008 13:51:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.codingadventures.com/?p=14#comment-9</guid>
		<description>&lt;p&gt;You are an ignorant&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You are an ignorant</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reason #947 why C++ is dangerous - and certainly not type-safe by Mark K.</title>
		<link>http://www.codingadventures.com/2008/04/reason-947-why-c-is-dangerous-and-certainly-not-type-safe/#comment-8</link>
		<dc:creator>Mark K.</dc:creator>
		<pubDate>Sat, 07 Jun 2008 13:05:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.codingadventures.com/?p=14#comment-8</guid>
		<description>&lt;p&gt;In general I agree with you that C++ is a horrible language, however, I think in this case you are attacking a straw man. The reason is that you almost never see examples of:&lt;/p&gt;

&lt;p&gt;A a = (x,y,z);  // or
B b = {x,y,z};&lt;/p&gt;

&lt;p&gt;...in real code. The reason is that C++ have been ingrained with the idea that they cannot statically initialize classes using the assignment operator. You will always see that its done with some constructor. Part of the reason for this is that C has just piss-poor support for anything other than scalar values. For example, tuples and dictionaries just don't exist in C. Even array's are broken since you can't in general do:&lt;/p&gt;

&lt;p&gt;C c = {1,2,3};&lt;/p&gt;

&lt;p&gt;for a real type C that you've defined. It has to be a struct with no constructors, like you noted in your post.&lt;/p&gt;

&lt;p&gt;Fortunately, some people have heard our complaints and have made C++ marginally more useful. Look at the Boost assignment library for an example of why the comma operator is a good thing to have. Of course, any language that needs a library to help out with something as simple as assignment is probably pretty broken.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>In general I agree with you that C++ is a horrible language, however, I think in this case you are attacking a straw man. The reason is that you almost never see examples of:</p>

<p>A a = (x,y,z);  // or
B b = {x,y,z};</p>

<p>&#8230;in real code. The reason is that C++ have been ingrained with the idea that they cannot statically initialize classes using the assignment operator. You will always see that its done with some constructor. Part of the reason for this is that C has just piss-poor support for anything other than scalar values. For example, tuples and dictionaries just don&#8217;t exist in C. Even array&#8217;s are broken since you can&#8217;t in general do:</p>

<p>C c = {1,2,3};</p>

<p>for a real type C that you&#8217;ve defined. It has to be a struct with no constructors, like you noted in your post.</p>

<p>Fortunately, some people have heard our complaints and have made C++ marginally more useful. Look at the Boost assignment library for an example of why the comma operator is a good thing to have. Of course, any language that needs a library to help out with something as simple as assignment is probably pretty broken.</p>]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 2.853 seconds -->
