News for hackers. Stuff that matters.
Re:Giving up on Julia by jandrese on Friday May 13, 2016 @04:38PM (#11693082)
No less than Dykstra has weighed in on the numbering of arrays.

http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF

Having worked with both, I'm inclined to prefer 0 based addressing in most cases. It's slightly less intuitive, but it generally leads to cleaner code.

Re:Giving up on Julia by e12e on Saturday May 14, 2016 @01:36AM (#11694680)
That argument never felt very convincing to me. Perhaps because it really is about aesthetics, not some deep philosophical ideas connected to numbers.

I see it as rather simple. If you're listing off-sets, starting at 0 makes sense, because there'll be something there. But if you're counting elements starting at 1 makes more sense. I don't have 9 fingers offset from my first one, which I call finger zero; I have ten fingers, starting with the first one.

A set with no members is the zero set, once you add one element, you have a set of one. An empty list contains no elements. It does not have a first member, because it's empty. Add an element, and it will have one member, and it will be in the first position. Not in the zeroeth offset from the beginning.

You can the numeric names of letters of a string in an array, but I don't see that as a compelling reason for naming the first letter of a word, the letter which is at the zero-eth offset from where the word is held in memory. At best, it's a low level optimization, at worst it's just a leaky abstraction. Maybe you want to store the length of the word there (like in Pascal), for a different trade-off in terms of what is optimized.

Re:Giving up on Julia by rixed on Saturday May 14, 2016 @02:29AM (#11694777)
Indexing is not for counting elements, it's to reach a particular one.
Re:Giving up on Julia by e12e on Saturday May 14, 2016 @06:06AM (#11695389)
I still find it more useful to name it my tenth finger, rather than the ninth from the first. And I'm fine with my middle finger, finger number three - being the one that sits between the pairs of fingers made up of finger number one and two, and fingers four and five. I don't really see how it's any better to count up from the zeroeth offset of the first finger to the second offset to get to the middle finger.
Re:Giving up on Julia by Avshalom on Friday May 13, 2016 @05:22PM (#11693312)
No less than Dykstra spouted a half hearted list of some properties and then made a proclamation based entirely on aesthetics.
Re:Giving up on Julia by banku_brougham on Friday May 13, 2016 @07:50PM (#11693914)
no less than dykstra was convicted of grand theft auto. https://en.wikipedia.org/wiki/Lenny_Dykstra

I think you mean Dijkstra, who did say that, because of an argument with mathematicians about indexing from 1.

Re:Giving up on Julia by pygy_ on Friday May 13, 2016 @08:17PM (#11693992)
In Dutch, ij and ÿ are interchangeable.
Re:Giving up on Julia by saghm on Friday May 13, 2016 @09:04PM (#11694119)
My Dutch professor in college actually wrote out the "ij", but the tail of the "i" connected with the "j", making it appear to be "ÿ". It kind of blew my mind the first time I saw him write it out haha
Re:Giving up on Julia by pygy_ on Friday May 13, 2016 @09:19PM (#11694165)
In cursive, it is often indistinguishable too.
Re:Giving up on Julia by hbogert on Saturday May 14, 2016 @03:26AM (#11694926)
In print, NO. You really can't interchange the two. As already said, in handwriting they may look similar, however we would never mean the actual ÿ, since it simply is something else which is used in Greek and French (and others).

There's even a section about this on wikipedia: https://en.m.wikipedia.org/wiki/IJ_(digraph) subsection "technical details".

Re:Giving up on Julia by pygy_ on Saturday May 14, 2016 @04:14AM (#11695066)
At the very least it happens in Flanders. I've seen ijs ("ice") capitalized in cursive as Ys[0] on an ice truck, for example.

Edit: from Wikipedia[1]: "It used to be common, in particular when writing in capitals, to write Y instead of IJ."

So it's an obsolete practice...

----

0. something along those lines: http://alphabetprintables.org/alphabet_printables_cursive/up...

1. https://en.wikipedia.org/wiki/IJ_%28digraph%29

Re:Giving up on Julia by garyclarke27 on Saturday May 14, 2016 @03:14AM (#11694883)
I don't buy the Dykstra argument,1 base is more intuitive for me and for most non programmers, I would guess. Funny though how Americans use 1 based indexing for building floor numbers, but Europeans use zero based i.e. ground floor is zero in a European lift, 1 in a US lift.