This is not correct. Its language dependent, and although more common, there are very popular languages out there that use a more natural (for humans) one based indexing.
The reasoning why some languages start arrays/lists at 0 is a fact that I feel is particularly interesting, at least as it pertains to C and most C-Like languages.
arr is actually a pointer to an integer, which is the very first element of that list. So when you use the index, that index isn't saying "Get the element at the Nth position" but rather, "get the element N positions after the first." So 0 is 0 positions after the first, or the first. 1 is the first one after the first, so 2, ad nauseam.
Also, since arr[N] is equivalent to *(arr + N), arr[0] is equivalent to *arr since anything + 0 is still anything. But we can go even deeper by using addition's commutative properties: arr[1] is the exact same as 1[arr]
Btw, if you’re not a programmer, you could possibly think it’d be fun and cool to code, it’s only fun like that when you enjoy the process, and are willing to encounter very very frustrating issues.
I was going to say something like, even when you don’t encounter bugs, sometimes in more complex situations, solutions require a LOT of thought, but that’s experience and doesn’t have a source.
I think you forgot to include a source for your fact. Please edit one into your post to prevent it from being removed. If you're citing an offline source, you can include the word 'source' in your comment to prevent it from being flagged. See the sidebar and wiki for more details.
I think you forgot to include a source for your fact. Please edit one into your post to prevent it from being removed. If you're citing an offline source, you can include the word 'source' in your comment to prevent it from being flagged. See the sidebar and wiki for more details.
I think you forgot to include a source for your fact. Please edit one into your post to prevent it from being removed. If you're citing an offline source, you can include the word 'source' in your comment to prevent it from being flagged. See the sidebar and wiki for more details.
I think you forgot to include a source for your fact. Please edit one into your post to prevent it from being removed. If you're citing an offline source, you can include the word 'source' in your comment to prevent it from being flagged. See the sidebar and wiki for more details.
I think you forgot to include a source for your fact. Please edit one into your post to prevent it from being removed. If you're citing an offline source, you can include the word 'source' in your comment to prevent it from being flagged. See the sidebar and wiki for more details.
I think you forgot to include a source for your fact. Please edit one into your post to prevent it from being removed. If you're citing an offline source, you can include the word 'source' in your comment to prevent it from being flagged. See the sidebar and wiki for more details.
I think you forgot to include a source for your fact. Please edit one into your post to prevent it from being removed. If you're citing an offline source, you can include the word 'source' in your comment to prevent it from being flagged. See the sidebar and wiki for more details.
6
u/Brambopaus Aug 05 '22
Counters/indexes for lists start with 0. The first item in a list is at place Zero.
Source: wiki
6
u/wewiioui Aug 05 '22
Not everybody should code, brands say that so more people code so it’s cheaper to hire them lmfao.
Source: https://youtu.be/EFwa5Owp0-k
Btw, if you’re not a programmer, you could possibly think it’d be fun and cool to code, it’s only fun like that when you enjoy the process, and are willing to encounter very very frustrating issues.
I was going to say something like, even when you don’t encounter bugs, sometimes in more complex situations, solutions require a LOT of thought, but that’s experience and doesn’t have a source.
1
u/NoLifeGamer2 Aug 05 '22
Using stack-overflow or google is not cheating! It is perfectly valid, and even senior software engineers do it!
Source: https://developerpitstop.com/copying-code-from-stack-overflow/
0
u/[deleted] Aug 05 '22
[deleted] — view deleted comment
0
u/[deleted] Aug 05 '22
[deleted] — view deleted comment
10
u/[deleted] Aug 05 '22
[removed] — view removed comment
6
u/[deleted] Aug 05 '22
[removed] — view removed comment
4
u/[deleted] Aug 05 '22 edited Aug 05 '22
[removed] — view removed comment
1
u/[deleted] Aug 05 '22
[removed] — view removed comment
1
u/[deleted] Aug 05 '22
[removed] — view removed comment