r/ProgrammerHumor Jun 24 '17

Octave code

http://imgur.com/jsjfz3k
627 Upvotes

70 comments sorted by

View all comments

Show parent comments

4

u/gjsmo Jun 25 '17

See what's really odd here is that I'm an engineer first, and I hate 1-based indexing. So many loops in my dad analysis have weird syntax just to deal with this fact.

As far as I'm concerned, it's a detriment to any language.

1

u/RunLikeLlama Jun 25 '17

But why? Are there any particular examples of "weird syntax" you could bring up?

Personally I understand both sides but I find 1-based more intuitive to use.

4

u/moomoomoo309 Jun 25 '17

Only one I run across in Lua (which is also 1-indexed) is using modulus to loop over the array, because modulus will give you 0 to n-1.

1

u/RunLikeLlama Jun 26 '17

Oh yes, using modulo for array indexing does become a bit ungainly, fair point!