Let's suppose that I need to store the number of foo objects in a variable.
Not being a native English speaker, I always wonder what's the best (= short and immediately clear) name for that var.
foo_num
? num_foo
? no_foo
? foo_no
? or something else?
The full name should be number_of_foos
, but it's a bit verbose.
What's your favorite and why?
fooCount
if the variable isn't a constant,FOO_COUNT
if it is. :DSince the variable stores the count of the number of foo objects,
fooCount
gets my vote.I personally would go for
total_foos
ortotalFoos
depending on the language standard. It represents better that the value is a final total and not just a running count.It also makes more sense to say "I have 3 total foos" rather than "I have a 3 count of foos".
Overall, it's not a huge deal but I always use
total
overcount
!I'd go for
fooCount