Clarifying meaning isn't pedantic.
Using size and capacity instead of length on data structures with dynamic lengths was done before JS.
size
capacity
length
There was probably a discussion somewhere, where they argued for/against both.
Python implements len() as a function with the magic method __len__ precisely to have one consistent way of retrieving an intuitive "length".
len()
__len__
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Clarifying meaning isn't pedantic.
Using
size
andcapacity
instead oflength
on data structures with dynamic lengths was done before JS.There was probably a discussion somewhere, where they argued for/against both.
Python implements
len()
as a function with the magic method__len__
precisely to have one consistent way of retrieving an intuitive "length".