Hacker News new | ask | show | jobs
by huijzer 1137 days ago
Okay. I’ll bite. Why?
2 comments

sure, [0...N) ranges are composable, to be short
That is such a weird argument to me. I can count in the fingers of one hand the number of times in my life that I've had to compose ranges, it seems a strange thing to optimize for.
Splitting and combining back ranges is very common activity since about Core 2 Duo, when multi-core getting to be a normal.

I mean, computing mean - split range, get result per split and combine it back, and so on and so forth

You seem to have a weird fetish for composable ranges seeing your history of comments on exactly this topic (even this thread!). The number of times I have had to think about composability as you mention is close to zero. In fact, the off-by-one errors with C class of languages due to the open ended nature of the interval have bit me about 3-4 orders of magnitude more. There is an entire class of security bugs because of this. I find this obsession very strange, YMMV obviously.
I used Julia for a project back in 2016, and had the same adverse reaction to 1-based indexing. It's the same reason I have a hard time with Lua. Why? I suppose it's all rather superficial, but it's one of those things that just grates on me and I'll avoid it if I can. I'm not sure there's a logical explanation, but I've found the sentiment to be rather common among developers.
Same, but probably it's more of a familiarity bias rather than a logical one. I think there is a strong argument to index from 1 as is done in MATLAB, R etc. since it matches the way most people refer and think about lists in reality.

A brave decision from the authors though, I imagine they would have got less flak matching the more popular 0-index languages.

> I think they would have got less flak matching the more popular 0-index languages.

Possibly, though those of us already in the space would have found it a (slightly) less pleasant language then.