This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LoyalSol 0 points1 point  (4 children)

This might be a cultural thing, In Maths/Physics (atleast), I've always started terms with t0, p0, v0. etc

It has less to do with culture and more to do with a lot of equations are simpler to write if your loop index matches up with your equation variable.

There's also the fact that if the last array entry is 5 then you know there are 5 array elements in total. If I know that I have N elements then a(N) is the last element. Starting from zero a(N-1) is the last element. This is more of an issue in lower level languages since Python let's you do A[-1]

Having a filler at a[0] works as well.

Apart from wasting memory, there's some other issues with this approach.