6 ms·
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-bas
by christophilus 10y ago
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).
- brokencode 10y ago1-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.
- rcthompson 10y agoAs 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".
- baldfat 10y ago1-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.
- n00b101 10y ago1-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?
- cschmidt 10y agoMathematical 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.
- Fomite 10y agoMy 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.
- hasch 10y agocan 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.
- baldfat 10y agoMy 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.
- kkylin 10y agoAs 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.
- gabrielgoh 10y agoThe 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.