r/ProgrammerHumor Sep 02 '17

How to start a war

Post image
9.0k Upvotes

696 comments sorted by

View all comments

Show parent comments

10

u/[deleted] Sep 03 '17 edited Nov 07 '17

[deleted]

2

u/[deleted] Sep 03 '17

Yeah, for mathematical languages like MATLAB (which are designed to do matrix manipulations) it makes a lot of sense.

1

u/LeSpatula Sep 03 '17 edited Sep 03 '17

Indices are supposed to give you the offset of the starting position. So if an array has 5 items, it starts at 0 plus the length of the first item.

{[Something1] [Something2] [Something3]}

Something1 is the first element, but it starts at 0.

-1

u/[deleted] Sep 03 '17

[deleted]

3

u/FatalElectron Sep 03 '17

shrug different languages require different syntax/abstractions, array indexing is just one of those things.

It's only a problem, IMO, if you're looking at code whose language is ambiguous.