5 ms·
It is the year 2048. A hacker news veteran presses enter to fulfill her duty and reposts the sad story about Dan Luu and the Julia community. A greyed Stefan Ka
by shele 8y ago
It is the year 2048. A hacker news veteran presses enter to fulfill her duty and reposts the sad story about Dan Luu and the Julia community. A greyed Stefan Karpinski tries to object but his statement disappears behind thousands of Dijkstra postings. In the distance the voice of the zealots, chanting 1-based, 1-based...
- ModernMech 8y agoI don't understand this. Please elaborate.
- shele 8y agoControversies about this blog post and about Julia's 1-based arrays on HN often replace serious discussion about the programming language. Stefan Karpinski is one of the inventors of Julia, Dijkstra wrote a classic note in favour of 0-based indexing.
- ModernMech 8y agoThanks!
- stabbles 8y agoThe joke is that criticism of Julia is always the same: (1) Dan Luu's bad experiences in 2014, (2) some "giving up on Julia" blog post from 2016, or (3) bikeshedding about 1-based indexing. And when the discussion revolves around 1-based indexing, Dijkstra is almost always cited to prove objective superiority of 0-based indexing.
- ModernMech 8y agoThank you. So much inside knowledge rolled up! Culture context is important :)
- czep 8y agoIn math when we write a sum, we say "sum from i = 1 to n", not "sum from i = 0 to n-1". Zero-based indexing of arrays makes sense in a language like C where arrays are just pointers and offsets are determined with arithmetic on pointer addresses in memory. This is why we are trained to write code like "for (i = 0; i < n; i++)". But in Julia where one of the stated purposes is to be able to write code that looks like formulae, it is far more natural to use one-based indexing.
- deleted 8y ago[deleted]
- ModernMech 8y agoSure I get that. MATLAB and FORTRAN also use 1 based indexing, so that's nothing new. People have been arguing about that since 1950 :P I just didn't understand the context of the post.