<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: The Worst C Example Ever</title>
	<atom:link href="http://imranontech.com/2007/05/21/the-worst-c-example-ever/feed/" rel="self" type="application/rss+xml" />
	<link>http://imranontech.com/2007/05/21/the-worst-c-example-ever/</link>
	<description>Musings on technology, development, and the world in general</description>
	<lastBuildDate>Fri, 25 May 2012 18:09:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: luusaelaxcn</title>
		<link>http://imranontech.com/2007/05/21/the-worst-c-example-ever/#comment-10151</link>
		<dc:creator><![CDATA[luusaelaxcn]]></dc:creator>
		<pubDate>Mon, 03 Oct 2011 10:06:23 +0000</pubDate>
		<guid isPermaLink="false">http://tickletux.wordpress.com/2007/05/21/the-worst-c-example-ever/#comment-10151</guid>
		<description><![CDATA[r9GDND  &lt;a href=&quot;http://qwxirrwnvagj.com/&quot; rel=&quot;nofollow&quot;&gt;qwxirrwnvagj&lt;/a&gt;]]></description>
		<content:encoded><![CDATA[<p>r9GDND  <a href="http://qwxirrwnvagj.com/" rel="nofollow">qwxirrwnvagj</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jexpwdabl</title>
		<link>http://imranontech.com/2007/05/21/the-worst-c-example-ever/#comment-10145</link>
		<dc:creator><![CDATA[jexpwdabl]]></dc:creator>
		<pubDate>Thu, 29 Sep 2011 17:38:43 +0000</pubDate>
		<guid isPermaLink="false">http://tickletux.wordpress.com/2007/05/21/the-worst-c-example-ever/#comment-10145</guid>
		<description><![CDATA[VgLw2i  &lt;a href=&quot;http://sveplfldbccz.com/&quot; rel=&quot;nofollow&quot;&gt;sveplfldbccz&lt;/a&gt;]]></description>
		<content:encoded><![CDATA[<p>VgLw2i  <a href="http://sveplfldbccz.com/" rel="nofollow">sveplfldbccz</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Artie</title>
		<link>http://imranontech.com/2007/05/21/the-worst-c-example-ever/#comment-10143</link>
		<dc:creator><![CDATA[Artie]]></dc:creator>
		<pubDate>Thu, 29 Sep 2011 02:54:42 +0000</pubDate>
		<guid isPermaLink="false">http://tickletux.wordpress.com/2007/05/21/the-worst-c-example-ever/#comment-10143</guid>
		<description><![CDATA[Most help artliecs on the web are inaccurate or incoherent. Not this!]]></description>
		<content:encoded><![CDATA[<p>Most help artliecs on the web are inaccurate or incoherent. Not this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Impevehew</title>
		<link>http://imranontech.com/2007/05/21/the-worst-c-example-ever/#comment-9698</link>
		<dc:creator><![CDATA[Impevehew]]></dc:creator>
		<pubDate>Thu, 10 Dec 2009 14:04:27 +0000</pubDate>
		<guid isPermaLink="false">http://tickletux.wordpress.com/2007/05/21/the-worst-c-example-ever/#comment-9698</guid>
		<description><![CDATA[edgerbAnnuare
&lt;a href=&quot;http://avsjedmzhssk.com&quot; rel=&quot;nofollow&quot;&gt;Bded&lt;/a&gt;]]></description>
		<content:encoded><![CDATA[<p>edgerbAnnuare<br />
<a href="http://avsjedmzhssk.com" rel="nofollow">Bded</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phloidster</title>
		<link>http://imranontech.com/2007/05/21/the-worst-c-example-ever/#comment-9010</link>
		<dc:creator><![CDATA[phloidster]]></dc:creator>
		<pubDate>Thu, 06 Dec 2007 00:44:58 +0000</pubDate>
		<guid isPermaLink="false">http://tickletux.wordpress.com/2007/05/21/the-worst-c-example-ever/#comment-9010</guid>
		<description><![CDATA[This is a great example!  I&#039;d use this in an interview.  The many reactions are also very indicative of people&#039;s mindsets and maturity levels.

I love when a seemingly simple snippet of code demonstrates so many layers of understanding and misunderstanding.

To all those who do not understand why to program in C,  several of the posts address this well. I&#039;ll add this:

Cis essentially a &#039;portable assembly languge&#039;, and it is in fact more portable than any other language, when some consistent care is taken to be portable.  The language is very expressive and occupies the closest thing to a sweet-spot between the machine model and the human mental model, and it is quite readable, if a modicum of discipline and consistency is applied when writing in it.

There are more platforms out there than most programmers generally imagine.  Everything from embedded systems that run the telephone networks to various realtime industrial processes, to global scale transaction processing on mainframes, to network management, robust database internals, cryptography,  and operating systems are often written in C.  It&#039;s not all just Windows,  Linux and the Web.]]></description>
		<content:encoded><![CDATA[<p>This is a great example!  I&#8217;d use this in an interview.  The many reactions are also very indicative of people&#8217;s mindsets and maturity levels.</p>
<p>I love when a seemingly simple snippet of code demonstrates so many layers of understanding and misunderstanding.</p>
<p>To all those who do not understand why to program in C,  several of the posts address this well. I&#8217;ll add this:</p>
<p>Cis essentially a &#8216;portable assembly languge&#8217;, and it is in fact more portable than any other language, when some consistent care is taken to be portable.  The language is very expressive and occupies the closest thing to a sweet-spot between the machine model and the human mental model, and it is quite readable, if a modicum of discipline and consistency is applied when writing in it.</p>
<p>There are more platforms out there than most programmers generally imagine.  Everything from embedded systems that run the telephone networks to various realtime industrial processes, to global scale transaction processing on mainframes, to network management, robust database internals, cryptography,  and operating systems are often written in C.  It&#8217;s not all just Windows,  Linux and the Web.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: toxik</title>
		<link>http://imranontech.com/2007/05/21/the-worst-c-example-ever/#comment-7458</link>
		<dc:creator><![CDATA[toxik]]></dc:creator>
		<pubDate>Wed, 15 Aug 2007 01:31:41 +0000</pubDate>
		<guid isPermaLink="false">http://tickletux.wordpress.com/2007/05/21/the-worst-c-example-ever/#comment-7458</guid>
		<description><![CDATA[To #23, Patrick:

Using strdup() isn&#039;t really sensible either, although it&#039;ll probably work. The issue is that strdup() and friends can all return NULL when OOM (Out Of Memory) occurs, which just piles on to the code&#039;s length.

The other issue is that a general rule of thumb in C is to never expect to have to call free() yourself. If you&#039;re making an API that handles, say, foobars, you&#039;d probably have a foobar_new() which returns a new structure of that type, and a foobar_del() or likewise, even if it just does a simple free().

Reasoning behind it is that it allows the API to expand or shrink. It is a crucial part of API design; never let the user (the user of the API) fiddle with the internals. There&#039;s a Google TechTalk on it, I&#039;d link it but I&#039;m much too tired.]]></description>
		<content:encoded><![CDATA[<p>To #23, Patrick:</p>
<p>Using strdup() isn&#8217;t really sensible either, although it&#8217;ll probably work. The issue is that strdup() and friends can all return NULL when OOM (Out Of Memory) occurs, which just piles on to the code&#8217;s length.</p>
<p>The other issue is that a general rule of thumb in C is to never expect to have to call free() yourself. If you&#8217;re making an API that handles, say, foobars, you&#8217;d probably have a foobar_new() which returns a new structure of that type, and a foobar_del() or likewise, even if it just does a simple free().</p>
<p>Reasoning behind it is that it allows the API to expand or shrink. It is a crucial part of API design; never let the user (the user of the API) fiddle with the internals. There&#8217;s a Google TechTalk on it, I&#8217;d link it but I&#8217;m much too tired.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: toxik</title>
		<link>http://imranontech.com/2007/05/21/the-worst-c-example-ever/#comment-7457</link>
		<dc:creator><![CDATA[toxik]]></dc:creator>
		<pubDate>Wed, 15 Aug 2007 01:26:29 +0000</pubDate>
		<guid isPermaLink="false">http://tickletux.wordpress.com/2007/05/21/the-worst-c-example-ever/#comment-7457</guid>
		<description><![CDATA[Meh, I know there&#039;s a flamewar going on but I just *have* to say this (like a few other folks.)

The correct code is entirely logical. People saying &quot;C isn&#039;t for humans&quot; just aren&#039;t used to how manual memory management works (the alloca() version isn&#039;t a good idea either.)

As a decent C programmer, and that&#039;s what our original poster is trying to say, you know what to do here. The callee will give the called function operational space. (See numerous functions in libc; fgets(), recv(), ...)

Oh and for the record, just malloc()ing senselessly isn&#039;t such a good idea either because you have to check if you actually got memory allocated.

If I had to do this I&#039;d use a char[128] or so, and then pass it to the getpass() function which would _naturally_ only copy so many chars into a given char *.]]></description>
		<content:encoded><![CDATA[<p>Meh, I know there&#8217;s a flamewar going on but I just *have* to say this (like a few other folks.)</p>
<p>The correct code is entirely logical. People saying &#8220;C isn&#8217;t for humans&#8221; just aren&#8217;t used to how manual memory management works (the alloca() version isn&#8217;t a good idea either.)</p>
<p>As a decent C programmer, and that&#8217;s what our original poster is trying to say, you know what to do here. The callee will give the called function operational space. (See numerous functions in libc; fgets(), recv(), &#8230;)</p>
<p>Oh and for the record, just malloc()ing senselessly isn&#8217;t such a good idea either because you have to check if you actually got memory allocated.</p>
<p>If I had to do this I&#8217;d use a char[128] or so, and then pass it to the getpass() function which would _naturally_ only copy so many chars into a given char *.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://imranontech.com/2007/05/21/the-worst-c-example-ever/#comment-4739</link>
		<dc:creator><![CDATA[Patrick]]></dc:creator>
		<pubDate>Sat, 26 May 2007 02:08:39 +0000</pubDate>
		<guid isPermaLink="false">http://tickletux.wordpress.com/2007/05/21/the-worst-c-example-ever/#comment-4739</guid>
		<description><![CDATA[^ no. it should be an example of why only few people deserve to be considered real programmers.]]></description>
		<content:encoded><![CDATA[<p>^ no. it should be an example of why only few people deserve to be considered real programmers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavel</title>
		<link>http://imranontech.com/2007/05/21/the-worst-c-example-ever/#comment-4728</link>
		<dc:creator><![CDATA[Pavel]]></dc:creator>
		<pubDate>Fri, 25 May 2007 10:02:32 +0000</pubDate>
		<guid isPermaLink="false">http://tickletux.wordpress.com/2007/05/21/the-worst-c-example-ever/#comment-4728</guid>
		<description><![CDATA[Shouldn&#039;t this be an example of why C is inappropriate for human use?]]></description>
		<content:encoded><![CDATA[<p>Shouldn&#8217;t this be an example of why C is inappropriate for human use?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AsocialStudies</title>
		<link>http://imranontech.com/2007/05/21/the-worst-c-example-ever/#comment-4717</link>
		<dc:creator><![CDATA[AsocialStudies]]></dc:creator>
		<pubDate>Thu, 24 May 2007 01:29:30 +0000</pubDate>
		<guid isPermaLink="false">http://tickletux.wordpress.com/2007/05/21/the-worst-c-example-ever/#comment-4717</guid>
		<description><![CDATA[T., 

With all due respect, I understand the feeling that washes over a person once one comes to &quot;understand&quot; the deep intricacies of any topic via having read a seminal book on the topic.  However, I feel that being required to read such a thing before being able to ask questions about the standard difficulties one encounters when coding C is too curt, akin to RTFM, Stockholm Syndrome-style.  Yes, it&#039;s a badge of honor, but it&#039;s not worth anything to anyone but your peers.  If it seems to most everyone coding in C that C has some really wacky problems inherent to it, then the onus is on you to refrain from RTFMing the loln00bz.  The onus is on you to justify obvious shortcomings of C (which happen to be side-effects of its truly obvious advantages).  

Even if C&#039;s shortcomings are just the fact that most people who start coding in C don&#039;t follow the properly-prescribed way of doing so.  I mean, do YOU read the entire book that comes with your cellphone before you dive in and start messing around with its features?  No.  Like TCP/IP, the human way is a &quot;best effort&quot; attempt at extracting what &quot;just works&quot;, even if it&#039;s &quot;highly illogical&quot;, and even if, in the long term, there would be significant time-savings to learn things &quot;the proper way&quot;.  Some of us trade depth for breadth sometimes and wish for smoother translation between the breadth component of our existence and the depth of yours.  Without snippety YOU CLEARLY DIDNT READ uZ TEXTBOOKZ,NOOBIAN.

&quot;Computer, end program.&quot;]]></description>
		<content:encoded><![CDATA[<p>T., </p>
<p>With all due respect, I understand the feeling that washes over a person once one comes to &#8220;understand&#8221; the deep intricacies of any topic via having read a seminal book on the topic.  However, I feel that being required to read such a thing before being able to ask questions about the standard difficulties one encounters when coding C is too curt, akin to RTFM, Stockholm Syndrome-style.  Yes, it&#8217;s a badge of honor, but it&#8217;s not worth anything to anyone but your peers.  If it seems to most everyone coding in C that C has some really wacky problems inherent to it, then the onus is on you to refrain from RTFMing the loln00bz.  The onus is on you to justify obvious shortcomings of C (which happen to be side-effects of its truly obvious advantages).  </p>
<p>Even if C&#8217;s shortcomings are just the fact that most people who start coding in C don&#8217;t follow the properly-prescribed way of doing so.  I mean, do YOU read the entire book that comes with your cellphone before you dive in and start messing around with its features?  No.  Like TCP/IP, the human way is a &#8220;best effort&#8221; attempt at extracting what &#8220;just works&#8221;, even if it&#8217;s &#8220;highly illogical&#8221;, and even if, in the long term, there would be significant time-savings to learn things &#8220;the proper way&#8221;.  Some of us trade depth for breadth sometimes and wish for smoother translation between the breadth component of our existence and the depth of yours.  Without snippety YOU CLEARLY DIDNT READ uZ TEXTBOOKZ,NOOBIAN.</p>
<p>&#8220;Computer, end program.&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

