logoalt Hacker News

ncrucesyesterday at 2:16 PM2 repliesview on HN

But count is more clearly a dimensionless number of elements, and not a size measured in some unit (e.g. bytes).


Replies

layer8yesterday at 6:42 PM

I tend to use numFoos (short for “number of foos”), and only use fooCount when the variable is used for actual counting (like an errorCount variable that is incremented for each error).

Countof is strange, because one doesn’t talk about the “count of something” in English, other than uses like “on the count of three” (or the “count of Monte Cristo” ;)).