Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can turn any 1 based array into a 0 based array using a wrapper type that just gets inlined away.

Also have a look at https://github.com/giordano/StarWarsArrays.jl



Mose Giordano hit the nail on the head with this one. Who cares about 1 vs 0 based indices? If anything its a silly and minor design decision.

I worry about someones ability to solve real problems in any language if they can't get their head around an +1/-1 when indexing into an array.


> I worry about someones ability to solve real problems in any language if they can't get their head around an +1/-1 when indexing into an array.

This. Think about what this signals to employers and interviewers if someone throws a hissyfit over this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: