From using a number of programming languages and libraries I have noticed various terms used for the total number of elements in a collection.

The most common seem to be length, count, and size.

eg.

array.length
vector.size()
collection.count

Is there any preferred term to be used?
Does it depend on what type of collection it is? ie. mutable/immutable

Is there a preference for it being a property instead of a method?

10 Answers
10

Leave a Reply

Your email address will not be published. Required fields are marked *