Re:The Julia Language is Here to Stay
by yogo on Friday February 07, 2014 @12:12AM
(#7194928)
I actually like the syntax of Julia after taking a look from an article that was on HN a week or so ago. But being 1-based threw me off. It seems like such a small thing to fret over but I can't get past it. I must be brainwashed but everything starts at zero, even your ruler.
[ Parent
| on HN ]
Re:The Julia Language is Here to Stay
by snogglethorpe on Friday February 07, 2014 @12:24AM
(#7194956)
I'm a strong supporter of zero-based arrays (I grew up with C and for me zero-based indexing just seems natural and elegant), but in using Lua, which has one-based arrays, I've found I don't really mind at all.
I think the crucial difference is that Lua doesn't have the emphasis on pointers and address-arithmetic that C does. Zero-based array calculations are really useful for that, but for simpler array usage, either style seems to work fine.
So while I still favor zero-based indexing, I think the context matters a lot, and one-based indexing is not always a problem.
I don't think it's a problem. In fact, when I found myself hung up something as inconsequential as indexing, I question my own rationality. That's why I called it brainwashing because c, c++, javascript, php, java, python,... most of the top 10 languages use 0-based indexing and most likely we would all be comfortable if they had all taken the path of being 1-based.
It's sort of like driving on the left or on the right. You just get used to one and you think it's the right side :).
Re:The Julia Language is Here to Stay
by snogglethorpe on Friday February 07, 2014 @09:45PM
(#7200086)
Sure, I know that much of this is "learned preference."
What surprised me is that even that didn't actually seem to be a problem in practice [for me], even when frequently switching between zero-based (C++) and one-based (Lua) languages...