<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Head and Tail Pointers.  You definition ???</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/18310/head-and-tail-pointers-you-definition</link><description> No, this has nothing to do with &amp;#39;51s, but I want the opinions of some of you tenured chaps: 
 
In a circular queue, what do you consider the head and what do you consider the tail? 
 
I&amp;#39;ve always know the tail as the point (index, whatever) that points</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Head and Tail Pointers.  You definition ???</title><link>https://community.arm.com/thread/141454?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2004 17:42:11 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0703ddbb-8fed-4b45-b63e-c3c84d28aa83</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;In the interrupt-driven serial I/O routines I&amp;#39;ve written (&lt;a href="http://www.keil.com/download/docs200.asp"&gt;http://www.keil.com/download/docs/intsio2.zip.asp&lt;/a&gt;) I name the head and tail in and out.  I think that&amp;#39;s pretty clear.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Head and Tail Pointers.  You definition ???</title><link>https://community.arm.com/thread/137961?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2004 15:09:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:161c2898-d320-4fdb-9b19-79fee7112593</guid><dc:creator>Robert Wey</dc:creator><description>&lt;p&gt;&lt;i&gt;The old adage &amp;quot;comment for the benefit of others&amp;quot; may very well be true, but as we all, to some extent are egotistical, I like &amp;quot;comment for your own benefit&amp;quot; better.&lt;/i&gt; How true.&lt;br /&gt;
&lt;br /&gt;
Have you ever heard the argument &amp;quot;If you can&amp;#39;t comment it in the code well enough for ANYONE to understand, then you don&amp;#39;t understand it yourself&amp;quot;?  I love that one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Head and Tail Pointers.  You definition ???</title><link>https://community.arm.com/thread/134487?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2004 15:02:54 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6f17da42-5884-430e-adf7-728bb8e8d35b</guid><dc:creator>Robert Wey</dc:creator><description>&lt;p&gt;&lt;i&gt;I strongly disagree.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
I agree with what you said in that sense...yes, we all wonder WTF we did in our old code from time to time.&lt;br /&gt;
&lt;br /&gt;
What I was referring to was &lt;b&gt;specifically&lt;/b&gt; the &amp;quot;head &amp;amp; tail&amp;quot; terms:  I&amp;#39;ve never had any problem with understanding those in [b]my[/b] code because I&amp;#39;ve been consistent from day one with them.&lt;br /&gt;
&lt;br /&gt;
Dealing with &amp;quot;diaper code&amp;quot; where there&amp;#39;s 3 or 4 different authors mangling different styles together (which describes the current mess I&amp;#39;m saddled with) is a different story.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Head and Tail Pointers.  You definition ???</title><link>https://community.arm.com/thread/122625?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2004 14:55:28 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e9e3ce98-2e2d-4a16-94cc-65ad71b5ae69</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;i&gt;Frankly, working with one&amp;#39;s self is never a problem&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
I strongly disagree.&lt;br /&gt;
&lt;br /&gt;
Have you never had to work on some of your own stuff you had not seen for, say, 5 years and had to add/change comments to make your own stuff understandable to yourself?&lt;br /&gt;
&lt;br /&gt;
The comments, names etc used when in the middle of development may, at that time, make perfect sense, but to somone that does not have &amp;quot;the picture&amp;quot; in his/her head they may be total gobbelygook.&lt;br /&gt;
&lt;br /&gt;
The old adage &amp;quot;comment for the benefit of others&amp;quot; may very well be true, but as we all, to some extent are egotistical, I like &amp;quot;comment for your own benefit&amp;quot; better.&lt;br /&gt;
&lt;br /&gt;
Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Head and Tail Pointers.  You definition ???</title><link>https://community.arm.com/thread/111214?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2004 14:16:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:20425557-0800-4abc-8be4-cb68437c19ac</guid><dc:creator>Robert Wey</dc:creator><description>&lt;p&gt;Good analogy, but since you&amp;#39;re now the 3rd person to confirm the confusion, I&amp;#39;m convinced I&amp;#39;m going to change.&lt;br /&gt;
&lt;br /&gt;
Frankly, working with one&amp;#39;s self is never a problem.  Doing it with legacy code and with teams...becomes a different issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Head and Tail Pointers.  You definition ???</title><link>https://community.arm.com/thread/96810?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2004 14:00:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:be7970f2-f097-4c9b-9b38-775679eed808</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;Queueing at the head of a line at the bank or post office makes people mad.  That&amp;#39;s why I always enqueue myself at the tail and let the person at the counter dequeue people from the head of the line.&lt;br /&gt;
&lt;br /&gt;
Smart people do it &amp;quot;the one true way&amp;quot; ;-) -- Enqueueing at the tail and dequeueing from the head.  I personally don&amp;#39;t use the head/tail nomenclature because there is too much confusion.  So much so, that I&amp;#39;ve actually seen the head/tail roles reversed in the same client project.&lt;br /&gt;
&lt;br /&gt;
I do like the others have mentioned and use read/write pointers, get/put pointers, etc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Head and Tail Pointers.  You definition ???</title><link>https://community.arm.com/thread/72940?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2004 13:40:27 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f4b59fd1-7b25-478c-9906-9befc077312d</guid><dc:creator>Robert Wey</dc:creator><description>&lt;p&gt;I can&amp;#39;t disagree with either of your replies...makes perfect sense and I&amp;#39;ll probably switch to those terms.&lt;br /&gt;
&lt;br /&gt;
Problem is, I&amp;#39;m (once again) changing the diapers of someone elses *** child and a) the term &amp;quot;head&amp;quot; and &amp;quot;tail&amp;quot; seems to be used frequently, and b) they seem to be ass-backward from the way I learned it and from what I glean from web searches.&lt;br /&gt;
&lt;br /&gt;
Is there any standard when using these terms?  ...or did someone simply pull them out of thin air years ago?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Head and Tail Pointers.  You definition ???</title><link>https://community.arm.com/thread/43318?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2004 13:30:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:aedf5cd6-12c8-4578-92ab-cfacb9078789</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;I can not make head or tail of these names and have thus abandoned them.  I use fetch_ptr and store_ptr or fetch_offs and store_offs.  If someone reading your program can not &lt;b&gt;immediateley&lt;/b&gt; figure out which is which, then names contradict good programming practice.&lt;br /&gt;
&lt;br /&gt;
Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Head and Tail Pointers.  You definition ???</title><link>https://community.arm.com/thread/43317?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2004 13:27:06 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:15c87e2f-b2cd-431f-ad9f-579f97d875c3</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;I&amp;#39;ve always know the tail as the point (index, whatever) that points to the next available free space in the buffer. That is, data is placed IN at the tail...&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Rather than use ambiguous names like &amp;quot;head&amp;quot; and &amp;quot;tail,&amp;quot; why not use names that explicitly describe what they do - like &amp;quot;read pointer&amp;quot; and &amp;quot;write pointer&amp;quot; or &amp;quot;input pointer&amp;quot; and &amp;quot;output pointer.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Names should be chosen to add clarity!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>