Python "why" questions
Roald de Vries
downaold at gmail.com
Sun Aug 15 08:14:48 EDT 2010
On Aug 7, 2010, at 9:14 PM, John Nagle wrote:
> FORTRAN, MATLAB, and Octave all use 1-based subscripts.
>
> The languages which have real multidimensional arrays, rather
> than arrays of arrays, tend to use 1-based subscripts. That
> reflects standard practice in mathematics.
True, but that something is "standard mathematical notation" doesn't
mean it's preferable. For example, I have never seen keyword arguments
in mathematical notation, and it's definitely not standard practice,
but nobody would drop them in favor of standard mathematical notation.
In fact, I think, regularly mathematical notation can be improved by
standard programming notation.
Moreover, I don't see what's so nice about 'real' multidimensional
arrays; the way to construct multidimensional arrays from one-
dimensional ones is more orthogonal. And you never *have* to think
about them as being one-dimensional, it's just a bonus you can
(sometimes) profit from.
More information about the Python-list
mailing list