I find myself being too vague when naming variables
for example
$responseData = []
I mean, it is data, and it will be include in the response. What other synonyms for data do others use?
I find myself being too vague when naming variables
for example
$responseData = []
I mean, it is data, and it will be include in the response. What other synonyms for data do others use?
For further actions, you may consider blocking this person and/or reporting abuse
Erick Takeshi -
Stas Melnikov -
Phat -
Paul Adeyele -
Top comments (1)
If you don't mind very long variable names that can make lines so long that it could affect code readability, you could add what kind of response data it is. Some information is redundant when using types and classes, but redundancy can make it easier for other developers to understand your intentions and expectations.
$productListResponseData = []
We can probably omit the least meaningful part: "data".
Do you have any variables that don't contain data?
$productListResponse = []
We wouldn't have to call it response when it's either obvious (while fetching) or irrelevant (during further processing).
$productList = []
I tend to modify my variable names during an early explorative coding phase.
Some aspects might be added later, like when there is
... and so on, until it gets useful and unambiguous enough that I would dare to defend it in a severe code review.