48
7400
7y

Should I ever design a programming language, I'll aim for the golden middle course and let arrays start at 0.5.

Comments
  • 9
    Oh god,you are the real evil.
  • 2
    Think of all the funny issues arising from the limited precision of the floating point indices. At least you wouldn't have to round first inside a for loop. In most cases. Probably. I think.
  • 1
    @7400 the perfect way to trigger all mathematicians and programmers at the same time
    Way efficient!!
  • 2
    you are too late for that, JavaScript already has this. Try

    var a = [ ];
    a[0.5] = 1;
    console.log(a[0.5]);
  • 3
    .5 seems to be an issue, so let's go in the middle and let the programmer choose between 0.25-based arrays and 0.75-based arrays.
  • 1
    @Anjan1730-1 (((((that's because arrays are objects)))))
  • 1
    @AlgoRythm More specifically 'Maps'
Add Comment