开发者

Collection naming convention

开发者 https://www.devze.com 2023-01-18 04:49 出处:网络
how should I name array that holds widths of columns? I would use: int[] columnsWidths; but I saw in many places names like:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消