Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
It's kind of logical that with 0. Like 0 items before this item in an array (i[0]), 1 item before this item and so on.
-
zfor14678yEven better:
Index every array with a floting point number between 0 and 1, where 0 is the first item and 1 is the last. The items in between would have an index proportional to their position. E.g. Indices for [1, 2, 3, 4, 5, 6] would be:
0,
0,1666666667
0,3333333333
0,5
0,6666666667
0,8333333333
1
And imagine when you loose precision with a larger array...
This is just pure evil 😈 -
We should index them with the index items related fibonacci number^-1
For example
0 -> 1/1
3 -> 1/5
5 -> 1/13
Related Rants
-
ericfledderman7The best parts of being a developer: 1. Full Internet access and admin rights. 2. It's nearly impossible for ...
-
manrock0075Knowing that yours is probably the last job that will be automated, followed only by complete annihilation of ...
-
Niro3Putting headphones on and being left alone
Should array indexes begin with 0 or with 1?
To end this discussion I propose they begin with 0.5.
undefined
wk23