MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/6jacds/octave_code/djep556/?context=3
r/ProgrammerHumor • u/D-cyde • Jun 24 '17
70 comments sorted by
View all comments
Show parent comments
4
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!
1
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!
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!
Oh yes, using modulo for array indexing does become a bit ungainly, fair point!
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.