by nadams · 11y ago · 0 comments
sigh
PHP - count
Python - len
C++ - .size (vector)
C - macro or stored
C# - .Length
Good naming in programming is an art.
To be logical at all, the name should be "numelemsof" or "countelemsof" ... but I guess, those names are already to long for C purists ...
Whenever you write a new type, just write a sizing function for it using sizeof. I like that Go is taking a similar route, except that one just implements the signature.