<story><title>Again on 0-based vs. 1-based indexing</title><url>https://hisham.hm/2021/01/18/again-on-0-based-vs-1-based-indexing/</url></story><parent_chain><item><author>tremon</author><text>It is non-intuitive, but it doesn&amp;#x27;t happen only in programming. Look at sports reporting, for example (basketball, football). When they say something happened &amp;quot;in the 6th minute&amp;quot;, it happened between 05:00 and 05:59. The difficulty isn&amp;#x27;t solely with programming.&lt;p&gt;You can use the same mechanism (minutes:seconds) to explain the half-open ranges: does a range(0,30) mean from 0:00 to 30:00 or from 0:00 to 30:59? If the second half of the match starts at 30:00, does the first half really end at 30:00 or is it really 29:59:99...9?&lt;p&gt;For most basic concepts, there&amp;#x27;s always real-world examples to use so that the teaching doesn&amp;#x27;t have to be abstract.</text></item><item><author>tragomaskhalos</author><text>One thing I would hope there is consensus on is that 1-based indexing is easier to &lt;i&gt;learn&lt;/i&gt;. My son is doing Python at school, and the &amp;quot;first-element-is-actually-element-zero&amp;quot; is something that has to be dinned into them, a sure sign that it is non-intuitive. In similar vein, as adult programmers we know that the half-open range is the most useful mechanism for expressing a sequence, but again we have to explain to kids that if they want the numbers 1 to 12 (eg to do a times table program) they must type range(1,13), which at that stage of their learning just seems bizarre. Actually I could go on at length about why Python is a terrible teaching language, but I&amp;#x27;ll stop there !</text></item></parent_chain><comment><author>userbinator</author><text>There&amp;#x27;s another non-intuitive and also inconsistent usage of ranges that I find rather confusing: if you say that a meeting is from 9 to 10, it&amp;#x27;s one hour long. If you say that you&amp;#x27;ll be on vacation from January 20 to 21, most people seem to think that means two days.</text></comment>
<story><title>Again on 0-based vs. 1-based indexing</title><url>https://hisham.hm/2021/01/18/again-on-0-based-vs-1-based-indexing/</url></story><parent_chain><item><author>tremon</author><text>It is non-intuitive, but it doesn&amp;#x27;t happen only in programming. Look at sports reporting, for example (basketball, football). When they say something happened &amp;quot;in the 6th minute&amp;quot;, it happened between 05:00 and 05:59. The difficulty isn&amp;#x27;t solely with programming.&lt;p&gt;You can use the same mechanism (minutes:seconds) to explain the half-open ranges: does a range(0,30) mean from 0:00 to 30:00 or from 0:00 to 30:59? If the second half of the match starts at 30:00, does the first half really end at 30:00 or is it really 29:59:99...9?&lt;p&gt;For most basic concepts, there&amp;#x27;s always real-world examples to use so that the teaching doesn&amp;#x27;t have to be abstract.</text></item><item><author>tragomaskhalos</author><text>One thing I would hope there is consensus on is that 1-based indexing is easier to &lt;i&gt;learn&lt;/i&gt;. My son is doing Python at school, and the &amp;quot;first-element-is-actually-element-zero&amp;quot; is something that has to be dinned into them, a sure sign that it is non-intuitive. In similar vein, as adult programmers we know that the half-open range is the most useful mechanism for expressing a sequence, but again we have to explain to kids that if they want the numbers 1 to 12 (eg to do a times table program) they must type range(1,13), which at that stage of their learning just seems bizarre. Actually I could go on at length about why Python is a terrible teaching language, but I&amp;#x27;ll stop there !</text></item></parent_chain><comment><author>teekert</author><text>Yeah and kids are actually aged &amp;quot;1&amp;quot; in their second year.</text></comment>