5 ms·
> for a computer and how it functions And what about for a human and how it functions? Are humans here to make computers' lives easier or vice versa? Humans t
by mikec3010 8y ago
> for a computer and how it functions
And what about for a human and how it functions? Are humans here to make computers' lives easier or vice versa?
Humans think from 1...N inclusive and this is the source of a litany of bugs when users first learn a language.
And what you described in asm is just one implementation. In fact, the array documentation says Julia doesn't guarantee tight packing so it doesn't even apply. The next element could be anywhere, and in fact wont be in the case of heterogeneous arrays. Asm is also not straightforward. For instance zeroing a register isn't done with the mov instruction but xor
- celrod 8y agoI think vectorEQ's point was actually that 1-based indexes are a reasonable abstraction. "computers dont care for what is first idex...none is better, your compiler is taking care of business"
- ur-whale 8y ago>Humans think from 1...N I think you're assuming everyone thinks the way you do. I assure you that's not the case. There are legions of people (and not just programmers, math folks do it too) who don't "think from 1 to N"
- mikec3010 8y agoTrue, after they learn a programming language. I meant when we're children and taught to count, we don't start at 0.
- ur-whale 8y agoAgain assuming: that may be true in the place where you were educated.
- mikec3010 8y agoYou're assuming I'm wrong. Show me where kids are taught to count starting at zero.
- celrod 8y ago"taught to count" I think that is the key. "1, 2, 3. There are 3 apples." is a little easier than "0, 1, 2. There are 3 apples." Counting the first item as "1" total items leads to 1 being more natural in the same way that incrementing a pointer by 0 giving you the first element is more natural. The former is the abstraction layer most people are more familiar with.
- orhmeh09 8y agoIf you look at ranks for worldwide sporting events , you’ll note that approximately none of them indicates first (zeroth ?) place with a 0. Can you give an example of a place where education at early childhood level is carried out as you claim ?
- ur-whale 8y ago>ranks for worldwide sporting events You're right ... sporting events ... how could I have not included that very scholarly pursuit of engineers, scientists and programmers in my analysis. I'm not trying to claim that 0-based is better than 1-based. I'm just trying to point out that outside of the fairly limited crowd who spend their workday in things like Matlab and R, the vast majority of coders in the world in 2018 are working in 0-based indices languages. If Julia is a worthy language which aims to attract a crowd beyond the niche R/Matlab folks, then choosing 1-based indices is poor tactics.
- orhmeh09 8y agoSince you mentioned children learning to count, I tried to find a general, widely known case that would be as applicable around the world, and I provided a study examining why 0 can be a difficult concept (which humankind developed very recently). The number of toddlers who are engineers in the sense I think you’re talking about is approximately zero, too. Furthermore, the widespread mathematical / scientific computing languages have used 1-based from FORTRAN through Matlab and Mathematica. Statistical papers are published with accompanying R code , very rarely with Python. If 1-based indexing is too hard to get used to, you may not be in the target audience. Anecdotally, I used C and Python well before started R, and I’m not really the smartest bulb in the box. I was annoyed for about a week. If you have the knowledge of what you will use Julia for, this hurdle seems very minor in my opinion.
- orhmeh09 8y agoHere’s some evidence that may explain the rarity of such a thing and how children struggle with the concept : https://onlinelibrary.wiley.com/doi/abs/10.1111/j.2044-835X.1986.tb00995.x https://onlinelibrary.wiley.com/doi/abs/10.1111/j.2044-835X.... Two studies are reported investigating children's conceptions of the number zero. The first, with 31/2–61/2‐year‐olds, charts preschoolers' understanding that zero is a number among other numbers with its own unique value, namely nothing. Children's achievement of this understanding occurred in three phases. At each phase understanding of zero lagged behind comparable understanding of other small numbers. The second study, with 51/2–10‐year‐olds, investigated children's developing conception of simple algebraic rules, such as a + 0 = a. Results showed that even the younger children had some understanding of several algebraic rules. The older children had acquired more such knowledge, but at all ages algebraic understanding was advanced for rules pertaining to zero, in comparison to those pertaining to other small numbers. These results suggest that zero plays a special role in children's increasingly algebraic knowledge of number. We conclude that since zero is difficult to conceive of and use originally (Expt 1) children develop special rules for its use, and that this provides a first step towards their formulation of more general algebraic rules (Expt 2) and towards an expanded conception of number and mathematics.
- e12e 8y agoIf I arrange five biscuits on a plate, you'd prefer to eat the one at zero offset from the edge, rather than take the first biscuit? As for "a computer" - unless your actually writing code for memory allocation - you are (should be) writing to an abstract machine anyway (trivially, if you want to sum numbers in a dense 10^6 by 10^6 matrix - wouldn't it be nice to utilise 1024 cores if they are available? Unless you have side effects happening, do you really care about the order of additions? And if the numbers are 256 bit integers - do you want to care if they're stored big or little endian, in 8 or 16 bit words? In two's complement?).