Comment Re: [1]=overhead? Not always (Score 1) 520
If you're storing the length, then "iterate over array and perform this operation" (for example, for a search or a "double every element" transformation) can use the known length to set up a for loop, rather than having to check "am I at the last element of the array" for every element... This could be a good reason to store the length even if you don't want the cost of bounds-checking.