Indices Point Between Elements
11–20 of 66 posts
Re: Indices Point Between Elements
#12The visuals are definitely valuable in explaining this. It used to be popular, and still is in some circles, to debate whether programming languages ought start array indexing at 0 or 1. When talking about this with other programmers, I've discovered that a lot of the issues/confusion could be avoided by consistent use of terminology: Offsets/offsetting always being zero-based and indexes/indexing always being one-ba…
As to the point about floor numbering, the situation can be a little confusing in Canada. Some buildings label in the US style, labeling stories [1st, 2nd, 3rd] while others label in the UK style as [Ground, 1st, 2nd]. We also often mix them and you'll see [Ground, 2nd, 3rd], with ground sometimes replaced by main, or lobby.
Re: Indices Point Between Elements
#13Re: Indices Point Between Elements
#14Re: Indices Point Between Elements
#15The visuals are definitely valuable in explaining this. It used to be popular, and still is in some circles, to debate whether programming languages ought start array indexing at 0 or 1. When talking about this with other programmers, I've discovered that a lot of the issues/confusion could be avoided by consistent use of terminology: Offsets/offsetting always being zero-based and indexes/indexing always being one-ba…
Re: Indices Point Between Elements
#16Re: Indices Point Between Elements
#17[0] https://www.gnu.org/software/emacs/manual/html_node/emacs/Po...
edit: clarify Emacs reference in OP
Re: Indices Point Between Elements
#18This only adds to the confusion, as now there are 2 ways in which indices can be interpreted.
Re: Indices Point Between Elements
#19Ugh. Please no. This only adds to the confusion, as now there are 2 ways in which indices can be interpreted.
an index is an offset to a pointer in memory, shifted by the size of the structure it points to. there is no other way around, no magic tricks about index being between elements.
of course people never exposed from c miss out all of this, and then are left to made up bullshit about how stuff actually works
array index are offset to a memory location, plain and simple; if that requires more explaining than this, then there is the need to get back to tech the basic underpinning on how computer memory and addressing works
Re: Indices Point Between Elements
#20The visuals are definitely valuable in explaining this. It used to be popular, and still is in some circles, to debate whether programming languages ought start array indexing at 0 or 1. When talking about this with other programmers, I've discovered that a lot of the issues/confusion could be avoided by consistent use of terminology: Offsets/offsetting always being zero-based and indexes/indexing always being one-ba…
this is an exemplary case of citation needed if I ever saw one. maybe it's a valid debate for programming languages that doesn't allow people to do pointer arithmetic, which already restrict the field a lot, but even then that's sound as part of the 4GL bullshit that never really took off, and for good reasons