Collection naming convention
how should I name array that holds widths of columns? I would use:
int[] columnsWidths;
but I saw in many places names like:
columnWidths
or
colWidths
Of course "widths of colum开发者_如何学Cns" is only an example.
Moreover, I think there is also another case, when 2 words are not 2 separate words, but create some kind of name, e.g.
class TableView
How in this case variable's name should look like?
TableView[] tableViews;
or
TableView[] tablesViews;
Read Code Complete. But there is no right or wrong answer -- choose what suits you and your colleagues and be consistent.
精彩评论