1
Hello I would like to ask a question about attribute names. What would be the most appropriate way to name a list? Let’s assume that I have an attribute which is a list of Ufs. What would be the right way to name it? ufs
? listaUfs
?
In the book Clean Code, author Robert Cecil Martin says:
" The name of a variable, Function, or class, should Answer all the big questions. It should Tell you Why it exists, what it does, and how it is used. If a name requires a comment, then the name does not Reveal its Intent. "
Bearing this in mind I ask: putting the word "list" in this attribute is relevant information or is redundancy?
I would also like to know if it is correct to use plural words to name an attribute or not?
Related: Writing easy-to-maintain, readable code?
– Icaro Martins
Related: What are the best practices for naming tasks [closed]
– Icaro Martins
Related: Why not comment on the code?
– Icaro Martins
Related: How to know the right measure of comments?
– Icaro Martins
Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site (when you have enough score).
– Maniero