I remember this has been changed since version 0.7, but TBH, I don’t know why this was decided? Why Julia sometimes choose verbosity over brevity when there is no real ambiguity. When I read
sum(A,1) what else should I assume? Nothing other than summing array elements over the first dimension. For those who used Fortran, MATLAB, or even Python (Numpy) for years, making
dims=1 a mandatory argument is really weird.
Brevity is crucial in dynamic languages with a REPL like Julia. Your’e trying to make the clear thing clearer, even if it’s not so clear to a beginner (someone who didn’t use a programming language before), they will learn it once and write it a million times in the REPL. It could’ve been made optional at most like in other languages. Also, why
dims and not just
dim as in Fortran? Only rare cases will include nD arrays, n > 2. Yes, clarity is a good thing, but also choosing a sensible default is very important especially for dynamic coding in the REPL.
PS: I can’t find the issue number for the discussion about this change, I appreciate if someone can provide it here.