3 ms·
> but surely it's easier to overcome that than overcome all the little problems that stem from starting indices from 1. It's not. You're asking new learners to
by ModernMech 8y ago
> but surely it's easier to overcome that than overcome all the little problems that stem from starting indices from 1.
It's not. You're asking new learners to overcome a great deal of intuition when already attempting to learn a mind-bending thing like programming. I've taught C++ and Matlab side by side to freshmen in university. They learn C++ first and encounter all kinds of off-by-one errors the compiler doesn't help them catch. When they get to Matlab, the universal sentiment I've found is "wow, this makes so much more sense"
For new learners, 0 indexing seems like such a pointless frustration with an obvious solution. It can be a needless roadblock for people otherwise excited to learn.
- blt 8y agoAn underappreciated facet of matlab that makes it mistake-resistant: by default, all parameters are passed by value. Thus, all functions are pure / referentially transparent at their interface, even if mutation is used internally. This combination is the easiest for beginners to learn, IMO.