hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.3K
active users

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???

drmorr

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.