James said:
...
Yes. You agree on standard names for common concepts. In the
old days, when variable names were limited to six characters,
you established standard abbreviations as well. This shouldn't
be necessary for modern C++. (But might be appropriate in
contexts where the abbreviation was more frequently used than
the spelled out word. In a program dealing with certain types
of standards, for example, RFC1411 is probably preferable to
requestForComment1411.)
You base your argument on the assumption that the main and/or only reason to
strive some form of brevity in identifiers is (or, more precisely, was) the
limitation on the identifier length specific to old compilers. To me this is an
obviously faulty argument. Even without any physical limitation on the total
length of the identifier, there always be some non-precise intuitive limit after
which the overly long identifiers will severely hinder the readability of the
code. In order to keep the code readable the identifiers have to be reasonably
long (and I personally stick with one that are usually seen as excessively long
by the other members of the team I work in), but the lion's share of their
lengths has to allocated to describe things closely specific to the concrete
application and/or the field. This is exactly the reason why the more universal
concepts are better expressed in the abbreviated form.
And no, the picture here is not as black-and-white as you are trying to paint it
("standard" and "non-standard" prefixes). It is also strange to see you use that
argument against prefixes specifically, while it is obvious that the same will
actually apply to all abbreviations in general. And in practice any project of
moderate level of complexity will normally have a developed system of
abbreviations, which definitely will not be "standard". More precisely, it is of
course possible to get along without any abbreviations at all, but it will be no
more than an example of stubbornly bad programming style.
Arbitrary conventions are worse than natural conventions.
Firstly, "arbitrary convention" is an oxymoron, if you think about it.
Secondly, any convention is better than no convention. After all, there one
fundamental rule under all these different views and approaches: whatever one
chooses to do, one must be consistent.
The proper name is polygonCount or polygon_count. Or possibly
numberOfPolygons or number_of_polygons. (The choice of
camelCase or not is purely conventional.)
Absolutely not. 'numberOfPolygons' and 'number_of_polygons' might seem OK only
to those who fail to see the whole picture. Once they do, it becomes obvious
that 'number_of_polygons' blatantly unacceptable in general. It is immediately
clear to anyone who ever have to deal with
'number_of_incomplete_table_based_mos_transistor_models' (it's just one
example). Of course, you can personally resolve to sticking to 'number_of_...'
no matter what and tell everyone around that your are perfectly happy with that,
but don't be surprised if from time to time people around you will give you
polite hints about the value of proper abbreviation.