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

I have to admit never really dug into Julia. When it was new I read about it as I was looking for a replacement of python/numpy. But then I was really repulsed by the fact that array indices don't start at 0.

c.f. https://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF



As someone who's coded with both schemes, I really don't see it as being an issue - it's the equivalent of "I won't use Python because of whitespace."


I plan to train an NLP bot from Hacker News 1-based indexing discussions to automatically generate the mandatory thread on it so that nobody ever has to participate in it again. It's so unoriginal that it's a better fit for ML automation than a human brain.


Also these comments just tell us about the background of the commenter, and nothing else. Anyone who has had to translate numerical or scientific algorithms into both C and pre-array syntax Fortran finds Fortran’s 1-based indexing to be a more natural fit, I would suspect.


> Also these comments just tell us about the background of the commenter, and nothing else

I was about to say something similar, but the last time I did, people got upset ;-)

That and people complaining about certain characters being allowed in variable names in some languages (e.g. hyphen, question mark, etc).


Honestly, significant whitespace is a far more annoying design choice than 0 vs 1 indexing.


In practice, indexing is the least of anyone's problems. I switch between 0- and 1-indexed languages a lot and it's never an issue, I don't even have to think about it.


I disagree. When immersed in a language it doesn't tend to be an issue, but switching between them absolutely is. Over my career I've had to deal with a ton of off-by-one bugs in code that was prototyped in Matlab then ported to C++. My hope with Julia was that the language was fast enough that you wouldn't have this divide between prototype and production, but given the overhead in using it anywhere but a REPL, it doesn't look like things are going to work out that way.

On it's own, 1-based indexing certainly isn't enough to keep me from using a language though.


As someone who felt the same way, trust me. You'll hit it twice, and then start using eachindex/ begin,end and then you'll not notice it anymore.


A side note: wow Dijkstra really has some top-notch handwriting.


This really isn't a big deal. I switch between C/C++/R all the time and mixing zero/one indexing isn't some huge mental burden or source of intractable bugs--you get used to it after a few days.


Starting arrays at 1 deeply and personally offends me as well, but I honestly can't see that as being a reason to discard a programming language TBH.


This was my experience as well.




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

Search: