Comments by "" (@sirtra) on "You Are WRONG About 0 Based Indexing" video.
-
7
-
4
-
2
-
@MasterHigure why not use 0x69 as the start? Conceptually there is nothing preventing that, it hypothetically could be done, but when you get down into the nitty gritty it's problematic with the way in which binary systems work and programmers think.
If you skew from 0 it throws everything else off - humans didn't choose to use sizes that are powers of 2, it's a byproduct of the underlying system.
Take just 4 bits, if 0001 is the first entry, 0010 is 2nd, 0100 is 4th - if as a human you then look at it in two halves, so 2bits + 2bits meaning 01 + 00 what comes naturally to you as to what that represents? Is the 01 representing 1st or 4th or 5th entry? Why did i suddenly add 5th? Well if 01 is normally the 1st entry plus there is 2 other more significant bits to the right, with each bit having 2 values, making 4 combinations.. then using typical calculation methodology 01 plus 4 would be 5! Yet it should be 4 if you count in sequence from 0001 right?
It essentially creates a scenario where it becomes an unclear exception to the way of thinking elsewhere from a programatic point of view.
If you then throw in signed vs unsigned bytes into the mix it gets a whooooole lot more complicated.
All for what gain? How is the programmer benefitting from this? Do the pros outweigh the cons overall? Will it cause other unforeseen issues in the long run?
It makes debugging much harder as you have to translate or compensate for this weird exception and always be left second guessing, ie 4th or 5th?
What are the pros beyond feelings as i'm really not seeing any from a technical standpoint - conceptually sure, it may feel more comfortable or natural for certain people starting at 1 but honestly, i see it only causing more issues than it improves.
All the programmers i know, myself included, don't have any difficulties throwing +1 when ever it's needed (eg output to log files) to be more human friendly.
Each to their own though, if you think the nightmare of 1 based indexing is better, go right ahead! It can be done in most languages...
2
-
1
-
1