TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why do arrays start at 0?

413 点作者 snikolaev超过 2 年前

109 条评论

xg15超过 2 年前
I don&#x27;t quite understand the argument &quot;0-based being easier for pointer arithmetic is nonsense because the language doesn&#x27;t have pointers&quot;.<p>Whether or not the language presents the concept of &quot;pointer&quot; to the user is independent of whether or not it uses pointers internally. And if it exposes arrays as a concept, it has to implement them somehow.<p>The simplest possible implementation of arrays is having a start address and putting all elements next to each other in RAM. To get the address of a particular item, this layout naturally leads to the formula &quot;base address + index * element size&quot;, with &quot;index&quot; being 0-based. If you want to expose other indexing schemes in your language, you&#x27;ll have to add more logic to convert the user-visible index back to 0-based before you can obtain the address.<p>All of this is completely independent of the fact whether your language exposes pointers to the user or not.<p>Even the yacht story sort of hints at this:<p>&gt; <i>To keep people from having their jobs cut short by yacht-racing, Richards designed the language to compile as fast as possible. One optimization was setting arrays to start at 0.</i><p>If all indexing schemes were equal, why would this change even be an optimisation in the first place?
评论 #32584621 未加载
评论 #32587826 未加载
评论 #32584813 未加载
评论 #32585518 未加载
评论 #32586092 未加载
评论 #32584872 未加载
评论 #32584991 未加载
评论 #32584921 未加载
评论 #32585404 未加载
评论 #32585084 未加载
评论 #32590813 未加载
twanvl超过 2 年前
Other advantages of zero based indexing, beyond being &#x27;closer to the machine&#x27;:<p>It works better with the modulo operator: `array[i%length]` vs `array[(i+length-1)%length+1]`. Or you would have to define a modulo-like operator that maps ℕ to [1..n].<p>It works better if you have a multi-dimensional index, for example the pixels in an image. With 0 based indexing, pixel `(x,y)` is at `array[x+width<i>y]`. With 1 based indexing it is at `array[x+width</i>(y-1)]`. You might argue that programming languages should support multi-dimensional arrays, but you still need operations like resizing, views, etc.
评论 #32587394 未加载
评论 #32584032 未加载
评论 #32583583 未加载
评论 #32583879 未加载
评论 #32583274 未加载
评论 #32585931 未加载
评论 #32584368 未加载
diego_sandoval超过 2 年前
Because otherwise you would be wasting a perfectly good number for no reason, which means you need to use more bits to do the same thing.<p>To write 4 numbers (including zero) you only need two bits<p><pre><code> 0: 00 1: 01 2: 10 3: 11 </code></pre> To write 4 numbers if you avoid using the number zero, you need three bits<p><pre><code> 1: 001 2: 010 3: 011 4: 100 </code></pre> If you extrapolate that a little bit, you&#x27;ll realize that you&#x27;ll need two bytes (1 Byte + 1 bit from another byte) to store the indices of an array with 2^8 elements, which is just dumb.<p>Some of you might be thinking: you don&#x27;t need to store it the same way it&#x27;s written, you can just substract 1 from whatever the user typed and convert it behind the scenes.<p>Yes, you could subtract 1, but then you would be making the whole system more complex, opaque, and unelegant, while hiding information from the programmer for no good reason.
评论 #32584975 未加载
评论 #32586229 未加载
评论 #32585309 未加载
评论 #32586928 未加载
评论 #32587320 未加载
评论 #32587821 未加载
评论 #32585935 未加载
评论 #32585013 未加载
jaapsen01超过 2 年前
Edsger Dijkstra wrote an interesting article titled &#x27;why numbering should start at 0&#x27;. Perhaps not answering the question directly but an interesting read nonetheless.<p><a href="https:&#x2F;&#x2F;www.cs.utexas.edu&#x2F;users&#x2F;EWD&#x2F;transcriptions&#x2F;EWD08xx&#x2F;EWD831.html" rel="nofollow">https:&#x2F;&#x2F;www.cs.utexas.edu&#x2F;users&#x2F;EWD&#x2F;transcriptions&#x2F;EWD08xx&#x2F;E...</a>
评论 #32582827 未加载
评论 #32583839 未加载
评论 #32584007 未加载
评论 #32585124 未加载
bregma超过 2 年前
If you ask people which floor of building they&#x27;re on, it&#x27;s going to depend on which country they&#x27;re in. In North America, at least, the first floor you walk into (in a sane city: I understand there are some which do not qualify in this respect due to hills or historic disaster recovery) is the first floor. On other continents, you enter the ground floor and need to take stairs or an elevating device to get to the first floor.<p>&quot;Natural&quot; zero-based counting at its best.
评论 #32583993 未加载
评论 #32584192 未加载
评论 #32585102 未加载
评论 #32584382 未加载
评论 #32584651 未加载
评论 #32585743 未加载
评论 #32587937 未加载
评论 #32584680 未加载
hougaard超过 2 年前
It really comes down to a choice between a machine-focused (0) or human-focused (1) approach.<p>The 0 makes a lot of sense in a C pointer world where memcpy and other alike functions can be written very thight.<p>The 1 makes a lot of sense in a human world, when we count, we start at 1, we talk about the &quot;1st&quot;, counting on finger starts with 1, etc.<p>I once were at a Lua (1 indexed language) conference where this was discussed, and Luis started explaining why Lua was 1-index with this sentence: &quot;The 1st argument ....&quot; :)
评论 #32582525 未加载
评论 #32582374 未加载
评论 #32584096 未加载
评论 #32583000 未加载
评论 #32582857 未加载
评论 #32582362 未加载
评论 #32582622 未加载
评论 #32584111 未加载
评论 #32584073 未加载
评论 #32583609 未加载
评论 #32584874 未加载
评论 #32583426 未加载
评论 #32582513 未加载
评论 #32583696 未加载
评论 #32583286 未加载
评论 #32583685 未加载
评论 #32583300 未加载
评论 #32584323 未加载
评论 #32583580 未加载
评论 #32584079 未加载
评论 #32582475 未加载
walnutclosefarm超过 2 年前
There were a number of systems oriented languages that, while algol-like in syntax, used zero-based array indexing, predating C. BCPL was intended to be a generic systems oriented language, but Burroughs had ESPOL for their mainframe architecture, and HP wrote their operating systems and compilers in SPL, which was specific to their stack-oriented HP3000 architecture. All these used zero-based indexing, because for low-level, memory conscious manipulations, it&#x27;s much more natural than one-based. But nothing is universal, and IBM&#x27;s systems oriented languages (BPL, PL&#x2F;S, and PLS&#x2F;II) were more an evolution of IBM assembler and then Wirth and PASCAL, and used one-based array indexing.<p>Personally, I&#x27;ve always found zero-based more intuitive and satisfying, absent arbitrary indexing (in which case I&#x27;d chose zero-based for most purposes where there wasn&#x27;t a compelling solution based reason to use a different index base). But then spent years writing SPL ... I
评论 #32586017 未加载
dboreham超过 2 年前
Unusually for me, I read TFA first. Immediately thought &quot;this is all wrong&quot;, then realized 400 commenters had posted the same thing already.<p>I have Martin Richards book on my shelf, and for a while shared an office with his coworker. I&#x27;m also one of the few folks here who has coded in BCPL.<p>Ok, so that said, this article is obvious nonsense. Zero indexing comes from the CPU itself. It&#x27;s how you generate an indirect address by adding the offset. Many CPUs have this in hardware. They don&#x27;t support non-zero offsets. The reason some languages have zero-based indexes is that their developers had the mind set of doing the same thing you do when writing machine code. They probably also wanted to directly interface between their language and libraries written in assembler (and the kernel was typically written in assembler too). Also they wanted to be efficient. Any offset other than zero is not efficient because you can&#x27;t use the hardware addressing modes.<p>So then why do some languages _not_ have zero based indices? The obvious answer it that Mathematics by convention always used 1 as the base (or some arbitrary value). Many languages were conceived by mathematicians or people with a strong mathematical background.
franciscop超过 2 年前
I&#x27;ve discussed this a lot in real world in a different field: apartment floors. In Japan (where I live) they are 1-indexed, where the floor on the ground is number 1, while in Spain (where I am from) they are 0-indexed, where the floor on the ground is number 0.<p>Both have inconsistencies, like in Spain you might have a &quot;middle ground&quot; (entresuelo) which is neither 0 nor 1, but sits between, and is normally commercial or non-livable, reserving the 1 to the first floor where people live. I like that system better though because it usually goes 1 =&gt; 0 =&gt; -1 (underground), while in Japan you go 2 =&gt; 1 =&gt; -1, so I feel like it&#x27;s missing a floor. You could justify it though as 0 being the ground line, so +1 is &quot;the first above the floor and -1 is &quot;the first below the floor&quot;, but I still prefer having each floor to be a natural consecutive number.
评论 #32584449 未加载
评论 #32583339 未加载
onox超过 2 年前
Arrays in Ada start at the index based on the index type of the array. You can even use an enumeration type as the index:<p><pre><code> type Day is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); type Hours is array (Day range &lt;&gt;) of Natural; V : Hours (Monday .. Friday); </code></pre> Which index type you should use depends on the problem that you&#x27;re trying to model. You can find out the lower&#x2F;higher end of a type&#x2F;variable with the &#x27;First and &#x27;Last attributes.<p>IIRC there&#x27;s an RFC though to force the lower end of the index to a certain value like 1 or any other number&#x2F;enum.
评论 #32590418 未加载
评论 #32584121 未加载
AndrewOMartin超过 2 年前
&quot;Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration.&quot; -- Stan Kelly-Bootle
评论 #32583566 未加载
tomkaos超过 2 年前
Worst than 0 and 1 is to have the choice. In Visual Basic 6 you have the option between the base 0 or 1 for each module. It make debugging a nightmare and you can create bug just by copy&#x2F;pasting code from one program to other with a different base index.
评论 #32585507 未加载
评论 #32585667 未加载
jefftk超过 2 年前
My favorite example of this confusion is JS and (original) Java dates:<p><pre><code> &gt; new Date() Wed Aug 24 2022 ... &gt; new Date().getFullYear() 2022 &gt; new Date().getMonth() 7 &gt; new Date().getDate() 24 </code></pre> So 2022-08-24 comes out as (2022, 7, 24). One-based indexing for the year and day, zero-based indexing for the month.
评论 #32584836 未加载
hcrisp超过 2 年前
Dijkstra&#x27;s answer (linked in the article) is best:<p>&quot;When dealing with a sequence of length N, the elements of which we wish to distinguish by subscript, the next vexing question is what subscript value to assign to its starting element. Adhering to convention a) yields, when starting with subscript 1, the subscript range 1 ≤ i &lt; N+1; starting with 0, however, gives the nicer range 0 ≤ i &lt; N. So let us let our ordinals start at zero: an element&#x27;s ordinal (subscript) equals the number of elements preceding it in the sequence. And the moral of the story is that we had better regard —after all those centuries!— zero as a most natural number.&quot;<p><a href="https:&#x2F;&#x2F;www.cs.utexas.edu&#x2F;users&#x2F;EWD&#x2F;transcriptions&#x2F;EWD08xx&#x2F;EWD831.html" rel="nofollow">https:&#x2F;&#x2F;www.cs.utexas.edu&#x2F;users&#x2F;EWD&#x2F;transcriptions&#x2F;EWD08xx&#x2F;E...</a>
评论 #32584312 未加载
评论 #32583833 未加载
jschveibinz超过 2 年前
I have always assumed that is just one less operation required to resolve the absolute memory address.
评论 #32582215 未加载
评论 #32582243 未加载
评论 #32582184 未加载
v-yadli超过 2 年前
I&#x27;m fine with 0-based, 1-based or anything-based arrays (I recall it being convenient solving 8queen with pascal), but for Rage-Over-A-Lost-Penny sake, music note intervals are always beyond my understanding.<p>Same pitched notes are called &quot;interval 1&quot; and there goes thirds, fifths, sevenths... All off-by-one in my base-offset-addressing mind... And then major vs. minor which creates all kinds of &quot;aliased addresses&quot;...<p>I&#x27;d really love a BASE-12 floating number representation. Like 4.00 for the middle C; Chords can be then represented by a tuple of such numbers -- major = [+0.04, +0.07] (some sequencers already do something like that and I&#x27;m far better at reading that kind of sequencer data than a sheet)
评论 #32584928 未加载
评论 #32583935 未加载
shanewilhelm超过 2 年前
I found it interesting that the author phrased their critique so definitely, i.e. &quot;it&#x27;s NOT this and NOT that&quot;, yet concluded the article by saying their whole argument was speculative. That said, I do agree with their premise that it&#x27;s going to be pretty tough to get a definitive answer as to why 0-indexing won out. And their criticism of others being so ready to declare results is apt, if not a little ironic in this case :)
评论 #32582379 未加载
dhosek超过 2 年前
When he talked about BASIC having 1-based arrays, I had to check my memory against online AppleSoft BASIC documentation and indeed, AppleSoft, at least did have 0-based arrays.¹ I also had to check on Pascal which I haven’t written anything significant in for some 20 years and it turns out that by default, Pascal arrays are 1-based, but most of the code that I worked with (which tended to have its roots in Knuth-written Pascal) explicitly specified the range of indices.<p>⸻<p>1. As did all the other contemporaneous BASICs that I encountered. For added fun, when creating an array with DIM, you gave the highest index and not the number of elements so, e.g., DIM A(20) created a 21-element array. The 1980 Apple ][ manual I found which discusses both Integer BASIC and AppleSoft doesn’t admit that 0 is a valid index for an array, but elsewhere I saw it indicated as such which leads me to suspect that Integer BASIC has 1-based arrays.
评论 #32585536 未加载
评论 #32585498 未加载
anigbrowl超过 2 年前
<i>I may think that counting 0 as a natural number makes a lot of math more elegant, but clearly I’m just too dumb to rise to the level of wrong.</i><p><pre><code> fruits = [&#x27;apple&#x27;] \\ Hello I have fruits x = len(fruits) \\ Only one kind tho lol fruits[x] \\ OK here is what I have SUBSCRIPT OUT OF RANGE </code></pre> I have always hated zero indexing for this reason (other than thinking in assembler where it is beautiful). It is of course useful in many contexts, albeit with tradeoffs; more importantly everyone is used to it and it&#x27;s predictable. But I was absolutely thrilled to discover Julia defaults to indexing from 1 like a normal person.<p>Essentially what we have here is a mismatch between the tool (computer that does everything in binary) and the task (mathematical abstraction of quantities). Now it&#x27;s completely understandable that people work within the limitations of the tool when there is no other choice, but that&#x27;s the same sort of path dependency that creates technical debt.<p>If zero indexing were so great, mathematicians would have made it the default centuries if not millennia ago; but mathematicians don&#x27;t want to do off-by-1 adjustments on all sorts of common operations because it makes things unnecessarily complicated. To be honest, I think this has become a moat to keep people out of programming even though it&#x27;s a shallow one.<p>It could be interesting to test this, say by taking two classes of schoolchildren and teaching one Julia and the other Python (or...). By not having to take on the idea of zero-indexing at the same time as the concept of an array, the Julia group can get into collections using their intuitive understanding of the natural numbers. I expect that picking up language elements quickly will have a compounding effect and that at the end of the evaluation period the Julia group will be able to make significantly more complex programs than a control group.<p>Edit: in your heart you know I&#x27;m right
评论 #32593640 未加载
评论 #32589643 未加载
auggierose超过 2 年前
Funny, just a few hours ago I asked myself the related question &quot;Should indices start with 0 or 1?&quot; (not for the first time). I pretty much switch my opinion as many times as I think about it.<p>Here is a nice discussion on stackoverflow <a href="https:&#x2F;&#x2F;cseducators.stackexchange.com&#x2F;questions&#x2F;5023&#x2F;why-do-we-count-starting-from-zero" rel="nofollow">https:&#x2F;&#x2F;cseducators.stackexchange.com&#x2F;questions&#x2F;5023&#x2F;why-do-...</a><p>The first answer nicely retells the dijkstra argument: integer ranges should be described using <i>half open intervals</i>, and [n, m) is nicer than (n, m]. Furthermore, [0, n) is nicer than [1, n+1), and that&#x27;s that.<p>The second answer makes the observation that there is a difference between <i>indexing</i> and <i>counting</i>, and that even in daily life often the first element is indexed by 0.<p>Still, I rather like indexing the first element of a sequence with 1.
JKCalhoun超过 2 年前
&gt; The usual arguments involving pointer arithmetic<p>Yeah, I think this exactly why it is zero based. The index became a simple multiplier for sizeof(int).
评论 #32582384 未加载
ncmncm超过 2 年前
The crucial fact is that if your language supports 0-indexing, you can do that if you like. OR, you can pretend it has 1-indexing, and do that instead.<p>If your language doesn&#x27;t support zero-indexing, then you are stuck with 1-indexing, and that&#x27;s that.<p>So, zero-indexing is the natural thing to put in a language, as it accommodates everybody.
fvold超过 2 年前
&quot;It&#x27;s an offset from the beginning. The first element is 0 slots from the beginning.&quot; is what I was taught. (Of course, it&#x27;s more complicated than that, with pointer math etc etc, but that works as a general gist)<p>In the past, I&#x27;ve written roughly half a million lines of Lua. Arrays don&#x27;t always start at 0. I&#x27;ve regularly shaken my fist at Lua and cursed it&#x27;s wicked ways, but it&#x27;s really damn useful in a lot of contexts.
snarfy超过 2 年前
Indexes start at 1. Offsets start at 0.<p>Arrays in programming use offsets.<p><pre><code> for(int i=0;i&lt;10;i++) { array[i] = x; } </code></pre> The error here is calling it &#x27;i&#x27; for index. It should be &#x27;o&#x27; for offset.
评论 #32582806 未加载
labrador超过 2 年前
Because zero is a concept that can mean &quot;at the beginning&quot;<p><i>The symbol changed over time as positional notation (for which zero was crucial), made its way to the Babylonian empire and from there to India, via the Greeks (in whose own culture zero made a late and only occasional appearance; the Romans had no trace of it at all)</i><p>Another meaning is &quot;nothing&quot; but we&#x27;re talking about position, not nothingness<p><i>The mathematical zero and the philosophical notion of nothingness are related but are not the same. Nothingness plays a central role very early on in Indian thought (there called sunya), and we find speculation in virtually all cosmogonical myths about what must have preceded the world&#x27;s creation. So in the Bible&#x27;s book of Genesis (1:2): &quot;And the earth was without form, and void.&quot;</i><p><a href="https:&#x2F;&#x2F;www.scientificamerican.com&#x2F;article&#x2F;what-is-the-origin-of-zer" rel="nofollow">https:&#x2F;&#x2F;www.scientificamerican.com&#x2F;article&#x2F;what-is-the-origi...</a>
demindiro超过 2 年前
I find 0-based indexing easier to work with when working with (dynamically sized) multi-dimensional arrays. For example, with 0-based indexing getting an element at (x, y, z) can be done with<p><pre><code> a[z * h * w + y * w + x] </code></pre> But with 1-based indexing you need to substract one first from each component except the last:<p><pre><code> a[(z - 1) * h * w + (y - 1) * w + x]</code></pre>
kentonv超过 2 年前
The 1900&#x27;s were the twentieth century. Except the year 1900 specifically was still the nineteenth century; the twentieth century started in 1901 and ended at the <i>end</i> of 2000, much to the chagrin of all the chumps who celebrated the millennium a year early.<p>You know what would make all this confusion go away? Zero-based indexing.
asimpletune超过 2 年前
In English, the day of your birth, when you&#x27;re 0, is also your birthday. So, technically speaking, when you&#x27;re turning 29, you&#x27;re having your 30th birthday, even though no-one says it like that. I always assumed 0-based indexing was something like that, similar to the example given about the ground floor being the 0th floor in some countries and the first floor in others.<p>Another example is if I&#x27;m getting directions from someone, and they say, &quot;Walk 3 blocks that way&quot;, in my mind I conceptualize that I&#x27;m presently on the 0th block and I don&#x27;t yet count it.<p>I don&#x27;t think every day people disagree with these examples so much (well, maybe the birthday one, but that&#x27;s because we use the same word for the literal day as well as anniversary), and they&#x27;re all fairly intuitive. I never realized that 0-based indexing required such a deep background to be justified.
评论 #32584138 未加载
JustSomeNobody超过 2 年前
I liked how in Pascal, one had a lot more flexibility here.<p>Something like the following IIRC: Type IntArray = Array [-10...10] of Integer;
评论 #32591207 未加载
daneelsan超过 2 年前
In Mathematica&#x2F;Wolfram Languege, the part 0 of an expression is reserved for the head of the expression: f[x, y, z][[0]] == f. Or g[f][x, y][[0, 1]] == f.
WaitWaitWha超过 2 年前
I started programming in assembly, then Fortran, Algol, COBOL, etc.<p>0 based index makes sense to me. The memory location is offset 0 bytes from where the first data byte is stored (without getting into endianism).
评论 #32598722 未加载
dark-star超过 2 年前
Simple answer: because everything in computers starts at 0. Address 0 is the first byte of memory, etc.<p>You can now ask, &quot;why does everything start with 0&quot;? I guess because it gives you nice round (base-2) numbers. With 4 bits you can have 16 different &quot;numbers&quot;, either 0 to 15 or 1 to 16. However, representing the number &quot;16&quot; in binary requires 5 bits, so you need an additional bit for the same number of elements. So representing 4 bits as 0 to 15 makes more sense
Schroedingersat超过 2 年前
The correct starting ordinal is 0. A list with a 0th element has cardinality 1. This is a concept that exists in many places in english, where the naturality of starting with the zeroth element trumps inertia but english is wildly inconsistent so it has both.<p>Constructing the naturals without including 0 and starting with it is incredibly awkward. Addition doesn&#x27;t even have an identity.<p>Look at a clock, is 1 at the top, or is it the next one after the top.<p>Look at a ruler. Does it start at 1?<p>Do you want to have to shuffle everything around when you go from whole numbers to halves? Do you start at 0.5 or 0? Depends if it is &quot;halves&quot; or the real number 0.5<p>This is a recipe for pain and off by ones any time you&#x27;re dealing with time steps (which is why it&#x27;s so stupid that matlab and fortran are 1 indexed by default, if anything there&#x27;s a better argument for C to be 1 indexed than scientific languages).<p>Now index and compose a bunch of ranges. A half open range of two elements is incredibly stupid 1 &lt;= i &lt; 3.<p>So closed ranges go with 1 indexing. Composing and splitting them is incredibly awkward [a,c] is split into [a,b], [b+1, c] ... that&#x27;s kind of okay, but not unique as you could use [a,b-1], [b,c]. Now do [d,e], [e,f] compose at a glance?<p>Half open ranges go with zero indexing and they just work.
ur-whale超过 2 年前
So that modulo works the way god intended inside a ring buffer.
Taywee超过 2 年前
I&#x27;ve spent so long working with both 0-indexed and 1-indexed (I work with Lua a LOT at work) that it makes almost no difference to me, and I can switch between the two with usually no hiccups.<p>Either one is something you get used to with practice. I do prefer 0-based, but 1-based isn&#x27;t as big of a deal as many people treat it in the vast majority of situations, and almost every situation where you&#x27;d be using something like Lua in the first place.
ottoflux超过 2 年前
my thought is just &quot;why not&quot;?<p>0 is a number, and just because the west ignored it for quite some time (read: &quot;Zero: The Biography of a Dangerous Idea&quot;) we have these odd built-in aversions to it but in the end it makes plenty of sense.<p>0th element is 0, so why don&#x27;t we just do a better job of educating kids to start counting with 0 and thinking about 0.<p>in the end - as a CS person, i think it&#x27;s good - but i also don&#x27;t mind if you disagree with me. :)
phaedryx超过 2 年前
If it starts at zero we should call it an &quot;offset&quot;<p>That would fix so many of these discussions.
评论 #32585862 未加载
IshKebab超过 2 年前
0-based indexing is clearly the best option because it results in more elegant code and it matches what computers actually do.<p>In fact, it&#x27;s so fundamentally more elegant that I&#x27;ve come to the conclusion that the real issue is that it&#x27;s actually the mathematicians and language itself that got indexing wrong. Instead of &quot;first&quot; being associated with 1, it should be associated with 0. We should give athletes 0th place, and talk about the 0th man on the moon etc.<p>That&#x27;s where the cognitive dissonance for the 1-based-indexing people is coming from. They can&#x27;t deal with the fact that their &quot;normal&quot; way of indexing is wrong.<p>It&#x27;s a bit like how pi should really be tau (2*pi), or the electron should really be positive. We got it wrong, but we&#x27;re stuck with it because it&#x27;s too much of a hassle to change it. Fortunately computing got it right! But now there&#x27;s a mismatch with everyday life where people are used to the wrong thing.
dathinab超过 2 年前
Ignoring the past; 0 indexing is:<p>- closer to hardware<p>- makes index == element wise offset from the first element<p>- there are both algorithm which are (very slightly) easier to implement with 0 and 1 indexing, AFIK more of the &quot;bread and butter&quot; algorithm are easier with 0 then 1 (e.g. indexing of C-style arrays used all the time, heaps etc.)<p>- 0 is not special =&gt; less bounds checks in typed languages (if you have an unsigned int index you only have to check the upper bounds, with 1-index you also have to check for 0)<p>- 0 is not special =&gt; with signed integer you can have negative indices (from the end) in which case all signed integers are valid (but potential out of bounds), with 1 indexing you have a &quot;gap&quot; in the middle which for some (rare) use cases can be very painful to handle<p>So independent of what the history was. It&#x27;s just much more pragmatic to use 0-indexing in many common use-cases. Especially given that 1-indexing produces more special cases for very common use-cases makes it sub-optimal for both usability and performance.
de6u99er超过 2 年前
Reminds me of a simple implementation of a Prisoners and Boxes riddle that showed up in my YouTube feed where I had to add a comment so others (and eventually future older me) will understand what I did.<p>&gt;&#x2F;&#x2F; if one prisoner fails all are dead (1st try -&gt; tries = 0)<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;amalic&#x2F;c107b5289d946b758418778a95fdce64#file-prisonersandboxes-java-L32" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;amalic&#x2F;c107b5289d946b758418778a95fdc...</a><p>That being said, it seems to be a junior software engineer issue where the brain isn&#x27;t wired yet for &quot;0-based&quot; indexing. I don&#x27;t hear such complaints from more experienced developers who have simply learned to appreciate it because like in my example above it is more intuitive to me.<p>I have added &quot;and eventually future older me&quot; above because I don&#x27;t do much coding these days, and my career trajectory looks like it&#x27;s going to be even less in the future.
kshacker超过 2 年前
I can understand the rationale for 0 and 1. I can even understand the rationale for a arbitrary range (from -5 to +10) in current era where languages have iterated for many generations.<p>However I did not understand why they would have a range in the early days of programming. On one hand it would have been hard to make a language and its compilers and then you add arbitrary ranges?
评论 #32583920 未加载
tunesmith超过 2 年前
I always assumed it came back to math, and that t0 or time-zero is useful for the beginning state <i>before</i> anything happens.
评论 #32586397 未加载
chmod775超过 2 年前
Another reason can be performance&#x2F;memory.<p>When you index starting at 1, you either have to add&#x2F;subtract 1 internally, which sometimes but not always can be optimized away by a smart JIT&#x2F;compiler, or you have to &quot;waste&quot; the first element in memory, trading memory for performance.<p>Lua always subtracts 1, while LuaJIT instead went with the latter approach.
Symmetry超过 2 年前
For me, far more significant than anything else here is having to convert array indices into human readable text describing objects. And the objects are named by mechanical engineers who don&#x27;t use 0 based indexing. So my code is full of<p><pre><code> print(&quot;Finger {}&#x27;s motor has overheated&quot;.format(i+1))</code></pre>
zzo38computer超过 2 年前
I think that zero indexed is generally better, including that it involves adding the index number to the base address, and other properties that can be helpful.<p>However, it can also be useful for many purposes to allow arbitrary ranges, so a programming language probably should allow that; if the index of the first element is not zero, then the base address will not be the address of the first element (if the first element index is positive, then the base address may actually point into a different array, or a different variable). Then, if you have the base address and add the index, you will have the proper address of that element, whether or not the first index number is zero.<p>Zero is not always the most useful starting index; sometimes other numbers (which may be positive or negative) are useful. But, I think in general, zero is better.
petilon超过 2 年前
The best source for the development of C language is Bell Labs <a href="https:&#x2F;&#x2F;www.bell-labs.com&#x2F;usr&#x2F;dmr&#x2F;www&#x2F;chist.html" rel="nofollow">https:&#x2F;&#x2F;www.bell-labs.com&#x2F;usr&#x2F;dmr&#x2F;www&#x2F;chist.html</a><p>Excerpt:<p><pre><code> By a general rule, in B the expression *(V+i) adds V and i, and refers to the i-th location after V. Both BCPL and B each add special notation to sweeten such array accesses; in B an equivalent expression is V[i] </code></pre> C was designed to be as close to the machine as possible. Prior to C the only programming language for systems programming was assembly. If the compiler-generated code subtracted 1 from the index every time you indexed an array that would have been seen as not as efficient as assembly.
nullc超过 2 年前
Maybe my thinking is just warped by the language, but I think 0 indexing is the right thing most-- but not all-- of the time. Looking at my code I have relatively few places where I need to -1 to convert a natural 1 index into a zero index.<p>It would be easy for languages to offer two array access syntaxes, one for 0 and one for 1 like array[i] for 0 index and array{i} for 1 index access, then the accessing code could use the right tool for the job. Unlike defining the indexing type as a property of an array you shouldn&#x27;t have problems with accidentally using the wrong one at time of use.<p>... but to really know if it&#x27;s a good idea you&#x27;d have to test it, and sadly very few concepts in programming are subjected to any kind of rigorous scientific study.
beardyw超过 2 年前
Starting at one led to the whole &quot;2000 is not the millennium&quot; thing, as there is no year zero.
评论 #32585169 未加载
glitchc超过 2 年前
Array indices denote offsets from the base address. The first element is at the base address of the array, hence the offset is zero. It avoids a conditional when resolving the address, introducing it would slow down all forms of memory access across the language domain.
评论 #32583885 未加载
magpi3超过 2 年前
After programming in C for a while, I really began to have the feeling that arrays were physical things that took up space in RAM. When I think like this, starting an index at 0 is very intuitive, as 0 implies the origin point of the physical construct.<p>If you think of arrays just as a kind of abstract list, then beginning at 1 makes much more sense. No one who looks at a to-do list at home talks about the 0th thing on their list to do. But the spacial nature of arrays makes starting at 1 confusing. After I take 1 step, I am no longer at my starting point. And cycling through arrays in code for me has a very similar feeling to taking actual physical steps through a data structure.
andsoitis超过 2 年前
An Array in Ada is interesting. <a href="https:&#x2F;&#x2F;learn.adacore.com&#x2F;courses&#x2F;intro-to-ada&#x2F;chapters&#x2F;arrays.html" rel="nofollow">https:&#x2F;&#x2F;learn.adacore.com&#x2F;courses&#x2F;intro-to-ada&#x2F;chapters&#x2F;arra...</a><p>Like other languages, it is a collection of contiguous elements that can be selected by indexing.<p>Unlike other languages:<p>- any discrete type can be used for indexing, not just integers<p>- bounds can be any value (doesn’t have to start at 0 or 1. First index could be 13)<p>- one consequence of the aforementioned is that arrays are types that map to the problem domain, rather than being tied to the computing domain<p>- and more…
Guest42超过 2 年前
I&#x27;d claim intuitively that having all bits 0 is a proper starting point and more efficient if there were any constraints on address, which was likely the case historically.<p>I&#x27;m happy to hear any dissenting opinions if this is inaccurate.
oh_my_goodness超过 2 年前
&quot;math [...] sums seem to always be 0-indexed,&quot;<p>What? Is this some kind of trolling challenge? If you don&#x27;t care about math, just say so. Most people don&#x27;t. But making up a nonexistent convention is just silly.
thwarted超过 2 年前
If your arrays start at 0, you have offsets.<p>If your arrays start at 1, you have indexes.<p>&quot;0-indexed&quot; shouldn&#x27;t be a thing. I like the screenshot quote that refers to this as either &quot;1-origin&quot; or &quot;0-origin&quot;.
Stratoscope超过 2 年前
A related question: why is a rectangle containing a single pixel defined as (x,y):(x+1,y+1) instead of (x,y):(x,y)?<p>Here&#x27;s a discussion from some years ago that starts with some of Guido&#x27;s thoughts on array indexing and moves on to the QuickDraw coordinate plane and points and rectangles, including how grid lines and points are infinitely thin&#x2F;small, but pixels occupy the space <i>between the grid lines</i>.<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6602497" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6602497</a>
jfmc超过 2 年前
The general term of arithmetic and geometric sequences seem simpler when indexing from 0 rather than 1. I do not think that &#x27;1&#x27; is more human focused for anything than &#x27;0&#x27;.
cortic超过 2 年前
Its an absolute pain in my arse, i honestly don&#x27;t know what problems i would have with an array system that started at 1, but since the length method <i>sometimes</i> starts at 0 and sometimes 1, (I&#x27;m thinking Perl vs JS) I&#x27;m always forgetting whether to put = or &lt;= into for loops and when to add one for the read out or subtract 1 when looking at the array again. I mean in what universe should [2]+[3]=7?
Koshkin超过 2 年前
The <i>first</i> element having the index zero may be natural or unnatural <i>depending on the context</i>. In mathematics, we count the rows in a matrix starting from 1, but we count the monomials in a polynomial starting (or ending) with 0. Generally, there is less need to use zero as the starting index: the Common Era does not have &quot;the year zero&quot; (there, -1 is followed by +1), etc.
drfuchs超过 2 年前
Easy: I have an array with 256 elements. And I want to store the indexes of various elements of the array off in another data structure. So many of them, in fact, that it’s important that the index values each fit into a byte. So, I want the index values to be 0..255, and not 1..256, since 256 doesn’t fit into a byte.
评论 #32584243 未加载
xmprt超过 2 年前
That reminds me of this article about the history of hjkl in VIM: <a href="https:&#x2F;&#x2F;www.hillelwayne.com&#x2F;post&#x2F;always-more-history&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.hillelwayne.com&#x2F;post&#x2F;always-more-history&#x2F;</a><p>Lo and behold, it&#x27;s written by the same author.
codefreeordie超过 2 年前
Arrays start at 0 because they&#x27;re really just pointers. &quot;[x]&quot; is just shorthand for &quot;+ x * sizeof&quot;. The first element is the one stored at the pointer address (0 sizeofs ahead of the pointer, the next element is stored 1 sizeof ahead of the pointer, etc.
评论 #32582437 未加载
评论 #32582455 未加载
评论 #32582171 未加载
dang超过 2 年前
The article this one points to has had a few threads:<p><i>The origin of zero-based array indexing</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6879478" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6879478</a> - Dec 2013 (107 comments)<p><i>Zero-based arrays and the mythology of programming</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6708409" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6708409</a> - Nov 2013 (1 comment)<p><i>Citation Needed</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6595521" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6595521</a> - Oct 2013 (2 comments)<p>Threads about the EWD mentioned by jaapsen01:<p><i>Why numbering should start at zero (1982)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22162705" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22162705</a> - Jan 2020 (220 comments)<p><i>Dijkstra&#x27;s argument on why numbering should start at zero [pdf]</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17850441" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17850441</a> - Aug 2018 (1 comment)<p><i>Why numbering should start at zero (1982)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17765034" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17765034</a> - Aug 2018 (63 comments)<p><i>Why numbering should start at zero (1982)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13186225" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13186225</a> - Dec 2016 (216 comments)<p><i>Why numbering should start at zero (1982)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9761355" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9761355</a> - June 2015 (47 comments)<p><i>Dijkstra: Why numbering should start at zero</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=777580" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=777580</a> - Aug 2009 (71 comments)<p>Also these. Others? I&#x27;m a little surprised there aren&#x27;t more.<p><i>Why do we count starting from zero?</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17923391" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17923391</a> - Sept 2018 (1 comment)<p><i>Why C Arrays Start at Zero: I Don&#x27;t Know</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11228267" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11228267</a> - March 2016 (3 comments)<p><i>Why C Arrays Start at Zero: I Don&#x27;t Know</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11114704" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11114704</a> - Feb 2016 (2 comments)
评论 #32583809 未加载
smeagull超过 2 年前
Because indexing happens with integers. Back then space was a concern, so you&#x27;d use unsigned integers, and those start with zero. Internally they&#x27;ll all be using offsets, and its easier to not do a conversion, than to do a conversion.
ur-whale超过 2 年前
Unfortunate that the Julia folks weren&#x27;t exposed to this when they designed the language.
评论 #32584469 未加载
avisser超过 2 年前
Looking at my own coding experience, I certainly favor 0 over 1. When I examine why, I can&#x27;t help but see my aversion to &amp; distaste of Visual Basic as a driver.<p>VB is the only 1-indexed language I have used. VB is bad. Therefore 1-indexed languages must be bad.
calibas超过 2 年前
The index of an array is an integer, and integer values start at zero, so it seems like an obvious choice as to where the starting point should be. It&#x27;s only outside of computer science that it seems to be counter-intuitive.
asveikau超过 2 年前
There is definitely a bunch of math that works out better in 0 based indices. I saw this a lot when I was working on filesystem focused stuff.<p>I feel like I&#x27;ve also seen algorithms that work out better with 1 based indices, but not as many.
parentheses超过 2 年前
<a href="https:&#x2F;&#x2F;blog.nelhage.com&#x2F;2015&#x2F;08&#x2F;indices-point-between-elements&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.nelhage.com&#x2F;2015&#x2F;08&#x2F;indices-point-between-eleme...</a>
rmason超过 2 年前
Actually in not all languages do arrays start at 0. In ColdFusion for example arrays start at 1. I&#x27;ve never been able to receive a reason as to why CF&#x27;s original author, J.J. Allaire, did it that way.
评论 #32588872 未加载
评论 #32588862 未加载
评论 #32583882 未加载
评论 #32583860 未加载
mirekrusin超过 2 年前
Almost as interesting as hearing arguments for&#x2F;against tabs&#x2F;spaces.
lowbloodsugar超过 2 年前
The argument that &quot;BCPL doesn&#x27;t have pointers, so it&#x27;s not about pointers&quot; fails immediately because every language has pointers, but some of them don&#x27;t expose them to the developer.
notsapiensatall超过 2 年前
Nobody mentioned Lua? Really?<p>Lua&#x27;s arrays are 1-indexed, and it is a terrific interpreted language! Array[0] is nil, makes sense. v5.1 has a solid JIT, and it&#x27;s got a great 2D game engine called Löve2D.
评论 #32589961 未加载
mlindner超过 2 年前
Because back when computers were young, all bit representations were needed to represent something and having 000 not be used as a valid value wastes a huge percentage of available space.
civilized超过 2 年前
In defense of starting at 1: if you&#x27;re counting things, starting at 1 ensures that the last number you said is equal to the number of things you&#x27;ve counted so far.<p>Toddlers love this invariant.
make3超过 2 年前
I always assumed that it was because arrays and pointers would&#x27;ve been interchangeable in the start, and that adding a zero index times the object size gives you the first element
Gordonjcp超过 2 年前
Because memory starts at zero, because the lowest address you can select in memory has all its address lines set to zero.<p>If you don&#x27;t understand this, you should not be writing computer software.
评论 #32591248 未加载
pklausler超过 2 年前
Because sometimes we number things, and sometimes we count things.
korse超过 2 年前
base^0 = 1 base^1 = base base^2 = base * base et cetera.<p>I&#x27;ve always considered the index and the power to which a base has been raised to be equivalent in many circumstances.<p>Thus starting at 0 makes sense.
thomasahle超过 2 年前
Discussion form 2013: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6601515" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6601515</a>
osigurdson超过 2 年前
Wow, we are still talking about this, are we? Honestly, linear algebra texts should just give in and adopt zero based indexing for matrices at this point.
soheil超过 2 年前
The concept of nothing doesn’t really belong in the number line. It’s like inventing a new “number” to represent blue and then using it instead of pi.
zaroth超过 2 年前
Simple: Because you add zero to the memory address of an array to access the first element.<p>The array indexer was syntactic sugar for pointer arithmetic.
soheil超过 2 年前
Qbasic uses 1 and that’s what I always loved about it. Coincidentally it was the same language I learned programming with at age 12.
caxco93超过 2 年前
I always thought it was because it’s easier multiplying the index by the size of the array item to get the correct offset
quickthrower2超过 2 年前
I write code that interfaces between C# and R and you have to be careful to remember to do the indexing change. Fun!
mjcohen超过 2 年前
Languages like fortran and Ada allow arrays to start at any index. This allows you to do what matches your problem.
dirkg超过 2 年前
Natural numbers start at 0, so it makes sense.<p>1 is just as arbitrary as 2 or 79823 etc. Math wouldn&#x27;t work without 0.<p>Thats good enough for me.
unixbane超过 2 年前
So what&#x27;s the actual reason you&#x27;d want to have zero based arrays and such in your language (In 2020, not 1970)? In a language from scratch that doesn&#x27;t care about being like previous ones, and doesn&#x27;t care about micro optimization.<p>I&#x27;ve been annoyed recently by this obnoxious neckbeard behavior when they make things zero based for no reason (other than to conform to their supposedly existent philosophy), like Ratpoison and Screen selecting windows by a zero based index, which means you have to move your hand to the far right of the keyboard to select the <i>first</i> window with the 0 key, the far left to select the <i>second</i> window, with the 1 key, and one to the right to select the <i>third</i> window, with the 2 key.<p>I so happen to have been trying to work out a tangible explanation on paper of which system is better on trips a few weeks ago, and could not come up with one (and none are given in the article nor the top comments in this thread).<p>On a side note, the moment you say, &quot;zeroeth&quot;, you can no longer be sure anyone knows what you&#x27;re talking about because at any moment you may count in English or this pretentious UN*Xtard dialect of English. Seems like another pedagogical stumbling block held on to boomers and boomer-wannabes who just want to have their little counter counter counter culture or whatever.
patatino超过 2 年前
My 4 year old starts at 0 when asked to count, so proud! Never said a thing about starting at 0.
评论 #32583990 未加载
评论 #32583626 未加载
charlieyu1超过 2 年前
A problem with 0-based arrays is that 0 is the only index with a Falsely Boolean value.
Jemm超过 2 年前
Because ordinal counting has been a tenant of computer science since inception.
kybernetyk超过 2 年前
Because an array is just syntactic sugar for pointer arithmetic ... at least in C :)
kgwxd超过 2 年前
If everyone just called it offset instead of index there&#x27;d be no confusion.
tejtm超过 2 年前
For me it comes down to; are you enumerating intervals or items to offset into.
kwertyoowiyop超过 2 年前
Seeing 544 comments about this story has restored my faith in HN. :-)
waynecochran超过 2 年前
It&#x27;s an offset from the beginning. Simple as that.
Grustaf超过 2 年前
Simple: because we start with index 0 in mathematics.
评论 #32587836 未加载
User23超过 2 年前
Pascal&#x27;s arrays start at 1, at least by default.
评论 #32582853 未加载
评论 #32582248 未加载
notshuttingdown超过 2 年前
BSD bash arrays are 1 indexed for some reason
Koshkin超过 2 年前
But the first year of this century was 2001…
cpurdy超过 2 年前
Good article.<p>Especially the DBAD comment.
fomine3超过 2 年前
Why do months start at 0? is my real claim.
notpushkin超过 2 年前
The <i>Lessons</i> section is brilliant.
spullara超过 2 年前
0 is offset based. 1 is index based.
评论 #32583975 未加载
OJFord超过 2 年前
Why do tape measures start at 0?
323超过 2 年前
Obligatory, there are a lot of memes on this subject:<p><a href="https:&#x2F;&#x2F;www.google.com&#x2F;search?q=arrays+start+at+zero+meme&amp;tbm=isch" rel="nofollow">https:&#x2F;&#x2F;www.google.com&#x2F;search?q=arrays+start+at+zero+meme&amp;tb...</a>
jy14898超过 2 年前
data Position = Start | Next Position
juped超过 2 年前
Zero-based <i>indexing</i> is always wrong; an ordered collection of things does not have a zeroth thing.<p>Sometimes you have a data structure called an &quot;array&quot;, which means &quot;a bunch of things that are the same size next to each other in memory&quot;. You can store the address of the whole array as the address of its first element, and offset into it by an offset; clearly, the offset of the first element is zero, but it&#x27;s not the &quot;zeroth&quot; element.<p>And finally, sometimes you have cargo cult behavior by people who think that the way offsets into arrays work is because &quot;numbering starts at zero in computers!&quot; or some similarly wrong rationalization. This is when you get stupid things like (nth 0 list) in a lisp.
评论 #32585563 未加载
评论 #32586690 未加载
评论 #32585511 未加载
评论 #32586778 未加载
csours超过 2 年前
This reminds me of arguments about male -&gt; female and man -&gt; woman (and human etc). Without offending anyone&#x27;s delicate sensibilities - you may note that there is a short version and long version of those words, suggesting that the longer version is derivative of the short version.<p>However, when you examine the origin of the words, that is not the derivation. The derivation and path to English is quite complicated. You may feel a sense of righteous indignation or righteous repudiation on this topic. I would gently suggest deferring that feeling because I think the story is very interesting to follow.<p>That is not the end of the story though. The reason those pairs of words stuck around is almost certainly because it makes a consistent mental picture.<p>Bringing it back to the topic at hand - &quot;Why we use 0&quot; - because it works. There are many times when it has been evaluated, and at least to the people who design languages, it is more mentally appealing.<p><a href="https:&#x2F;&#x2F;www.etymologynerd.com&#x2F;blog&#x2F;man-vs-woman" rel="nofollow">https:&#x2F;&#x2F;www.etymologynerd.com&#x2F;blog&#x2F;man-vs-woman</a><p><a href="https:&#x2F;&#x2F;medium.com&#x2F;interesting-histories&#x2F;interesting-histories-female-male-woman-man-fd8f436a554c" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;interesting-histories&#x2F;interesting-histori...</a>
评论 #32583101 未加载