I think the thing I find most frustrating about programming languages is that there is no standard way to refer to the length of an array.
Python, go: len(array)
Java, JavaScript: array.length
Rust: array.len()
C++: array.size()
C#: array.Length
PHP: count($array)
Perl: scalar(@array) (lmao)
Swift: array.count
Kotlin: array.size
Like, seriously? Can't we agree on just this one thing???
I'm actually sort of shocked that nobody does array.length(). I was really expecting that to come up somewhere. I guess we all just _really_ hate typing those extra few characters.
@drmorr Technically Ruby does that, but due to implicit method calls it’s usually written array.length
@drmorr Why would you need a function, property fits better.