Mastodon Feed: Post

Mastodon Feed

Reblogged by kornel ("Kornel"):

drmorr@hachyderm.io wrote:

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: sizeof($array)
Perl: scalar(@array) (lmao)
Swift: array.count
Kotlin: array.size

Like, seriously? Can't we agree on just this one thing???

#programming #rustlang #golang #cplusplus #php #swift #kotlin #perl #java #javascript #python #csharp