5 ms·
My gripes, feel free to disagree: 1. Julia uses base-1 indexing. 2. Julia uses an "end" keyword everywhere, which is imho too verbose (and the corresponding "
by amelius 6y ago
My gripes, feel free to disagree:
1. Julia uses base-1 indexing.
2. Julia uses an "end" keyword everywhere, which is imho too verbose (and the corresponding "begin" is missing so it's inconsistent).
- jakobnissen 6y agoI would argue that if those really are your major gripes about Julia, you either have very bad priorities, or don't know enough about Julia to contribute to this conversation.
- psychometry 6y agoIf 0-indexing hadn't been the default for so many programmers for so many years (usually because the languages being used required actually thinking about arrays in terms of memory offsets) then it would feel very odd. Humans reason about counting in terms of the natural numbers, so 1-indexing is fine. Just ask any beginner CS student what they think of 0-indexing if you doubt this.
- veddox 6y agoI don't like those two either, but that doesn't change the fact that the rest of the language is absolutely ideal for what I do ;-) (ecosystem modelling)
- dgb23 6y agoDisclaimer: Not a Julia user. 1. Base-1 indexing is more natural and less verbose. My suspicion is that base-0 indexing grew out of language implementers wanting to reduce their mental overhead rather than a first-principles approach. AKA machine code leaking out to the higher level languages. 2. You have to have some way of structuring syntax. Whether you have "end", ")" or "}". It is not inconsistent to start with something else, like a function signature with the corresponding keyword. Again Julia opts for natural readability. Both of these complaints are rather superficial anyways. Julia is a marvelous piece of tech and has an interesting story to tell about type inference, multiple dispatch, performance, data-structures, general Lisp-yness and the merits of tailoring a language for a purpose/domain (and its users) in contrast to trying to adhere to paradigms and programmer culture (cults?).
- stabbles 6y agojulia> (1:3)[begin+1:end] 2:3 it exists
- forgotpwd16 6y agoI guess they meant in expression blocks (for, while, struct ...).
- stabbles 6y agoYou can always write julia> begin for i = 1:3 println(i) end end 1 2 3 /s
- pjmlp 6y agoAny ALGOL language user (or derived ones) will feel right at home with those issues.
- oblio 6y agoI can't say that I like or use Julia, but just regarding your comment, and because I've seen similar comments about other languages around: > 2. Julia uses an "end" keyword everywhere, which is imho too verbose (and the corresponding "begin" is missing so it's inconsistent). This is an absolutely childish approach to comparing or selecting programming languages. In my eyes, it says a lot about the maturity of software development as a discipline that a big chunk of our debates are at this level. We should discuss about quality, breadth and depth of standard libraries, quality of implementation of the most common interpreters/compilers, etc. I don't want to fault you personally, OP, I think this approach is quite widespread, unfortunately, one could say that it's part of our software development culture at this point.
- leadingthenet 6y agoBut a language's syntax is something you interface with literally every single time you're using it. Why would (even simple) aesthetic choices in syntax not matter, if they're such a big part of the experience?
- ddragon 6y agoWhile you do interface with it all the time, it's not something you'll be thinking all the time, at some point it will be completely invisible even though it's there (unless you're that bored). What will really be a big part of the experience is what offers actual resistance to solving your problem and actively waste brain power and not muscle memory, be it the fact that language semantics forces you to write the same thing all the time when a particular feature (like macros) could handle it trivially, the lack of some particular type safety makes it so you keep losing time debugging the same error, the interactive tools being lacking forcing you to waste time debugging with prints, you have a workflow where the JIT lag keeps breaking your pace, the community doesn't have a culture of documentation making it so you'll lose time trying to decode the source, etc...
- goatlover 6y agoScientific computing languages usually are base-1, such as Fortran and R. Python is a general purpose, so naturally it takes after C.
- forgotpwd16 6y agoBase-1 makes sense in sciences where you've Fortran, MATLAB, R, Mathematica. If anything before Python's rise in popularity base-0 was the strange choice. Fortunately you can use arbitrary indices with OffsetArrays.
- pauljurczak 6y agoNot really. It was a choice for C and C++ and it has a very solid low level implementation and efficiency motivation. Unfortunately, it also became a curse for these languages. After many decades of existence, they still haven't introduced proper multidimensional arrays, other than a hodgepodge of competing library implementations.