News for hackers. Stuff that matters.
Re:Julia 0.5 Highlights by christophilus on Tuesday October 11, 2016 @11:24AM (#12685232)
I'm curious to hear from people who are using Julia on a regular basis. What's the UX like? I only looked at it briefly and was turned off by some things (1-based indexing comes to mind). But I really liked other things (multiple dispatch).
Re:Julia 0.5 Highlights by baldfat on Tuesday October 11, 2016 @11:48AM (#12685490)
1-based for statistics is a STRONG reason to use it. 0 based is ridiculous for a statistics program and the reason why I left Python. I understand for looping and the arras to be internally 0 but when doing statistics I should have to use two different index.
Re:Julia 0.5 Highlights by n00b101 on Tuesday October 11, 2016 @12:38PM (#12686000)
1-based for statistics is a STRONG reason to use it. 0 based is ridiculous for a statistics program

Could you elaborate on that? What about statistics do you feel makes it necessary to have 1-based indexing?

Re:Julia 0.5 Highlights by Fomite on Tuesday October 11, 2016 @04:22PM (#12688193)
My flippant answer: "No one is ever assigned Patient ID 0"

It's mostly about expectations. Users of statistical software, who may or may not be programmers by inclination, use 1-based indexing. The program they came from uses 1-based indexing (R, SAS, Stata, etc.). When you talk about data, you rarely talk about the 0th observation. It's just a recipe for errors to have to code switch between 0 and 1-based indexing.

Re:Julia 0.5 Highlights by cschmidt on Tuesday October 11, 2016 @04:09PM (#12688085)
Mathematical notation is almost always 1 based. Let $v = 1 \dots n$, that sort of thing. So I find translating mathematics into code (which I seem to do quite frequently) much easier with 1 based indexing. (One exception being if you have a lot of modulo arithmetic.)

I've used both 0 based (python, C++), and 1 based (R, matlab, mathematica), but I really belive 1 based is the right choice for Julia. It isn't necessary, but it feels better.

Re:Julia 0.5 Highlights by hasch on Tuesday October 11, 2016 @01:01PM (#12686223)
can you give me an example? I did all sorts of numerical indexing programming, from fortran, matlab, python/numpy and R, and I am definitely more comfortable with 0 based indexing.
Re:Julia 0.5 Highlights by baldfat on Wednesday October 12, 2016 @08:31AM (#12692214)
My quick philosophy/logic background can you make a strong arguement for why Julia/R (statistical programming) should use 0 based?

I am totally fine with zero base in Python and Lisp and such. BUT when I am doing statistics and the math is 1 based I think the ability to make a mistake is to big. Also for subset in R df[1, 1] would be the 2nd row and 2nd column would just throw most users of R.

Re:Julia 0.5 Highlights by gabrielgoh on Tuesday October 11, 2016 @04:54PM (#12688444)
The 1-based indexing is a smaller deal than people make it out to be. If you're doing scientific computing, it's very unlikely you'll be doing too many fidgety things with indexes anyway. I switch between Julia and numpy with ease.

The REPL is on par with ipython (perhaps even better). Also are some IDEs for it but they aren't quite there yet.

Re:Julia 0.5 Highlights by brokencode on Tuesday October 11, 2016 @11:44AM (#12685440)
1-based indexing is strange to a programmer, but it's commonly used in mathematical computing software like Matlab. It's actually more convenient in a lot of cases, since mathematics usually uses this form of indexing.
Re:Julia 0.5 Highlights by rcthompson on Tuesday October 11, 2016 @11:54AM (#12685552)
As a primarily R and Python programmer, I've actually found that thinking in terms of 1-based indexing comes a lot more naturally to me than 0-based indexing, despite having worked exclusively in 0-based index languages for years before picking up R.

The only confusing edge case I've encountered is in biology, when manipulating a genomic region of zero length. Such a region is used, for example, when representing the location of an insertion of additional sequence. Before the insertion, the region has zero length. So, if the insertion occurs after the 500th element, then the zero-length range, in 1-based indexing, starts at 501 and ends at 500. However, it's rarely necessary to deal with this case directly, as such a range can be constructed as "starting at 501 with length 0".

Re:Julia 0.5 Highlights by kkylin on Tuesday October 11, 2016 @01:35PM (#12686553)
As others have mentioned, numerical packages like Matlab use 1-based indexing. Most of us who have a numerics background are used to switching back and forth, so I'm fairly oblivious to it.