count vs length vs size in a collection

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 Comment