The name of the variable to which
an object is assigned
should give a clear description of
what the object holds.
For example,
an object that contains
information on a user
should not be given names such as
object
, data
, info
or any other name
that does not describe the content of the object.
Names such as user
or profile
should be used since they give a clear idea
of what the object will contain.
It is also important to note that
names like userObject
or userData
should be avoided.
The name user
itself gives the idea that
the value is an object
that contains information on a user.
Suffixing user
with
Object
or Data
is redundant.
The name of object properties,
i.e., the keys of objects
should also follow the
naming conventions of a variable.