Single letter variable names are very useful as loop counters, or in small utility functions where the functionality is obvious. They have their place and should not be discounted
Yes, using single letter variables in loops is justifiable because its standardised but single or double letter names using in functions or variables which are spread across files should be avoided because of it cannot be searched easily. Even for utility functions, names should be clear enough to understand what the function does.
Sorry, but I disagree. This function gains nothing by 'meaningfully' naming the parameter:
constisItemRed=i=>i.colour=='red'
I've been writing code for about 38 years - 27 of those professionally. Experience has taught me that the best code is succinct and clear. It really isn't necessary to give everything a meaningful name - especially when the context makes it perfectly obvious what things are, and what they do.
Overly verbose code is exhausting to read, and totally unnecessary
Sorry, if I came across as unclear or rather misunderstood your point. But I totally agree to what you just mentioned. What I was referring to was the name of the function and not the parameters, in this case being isItemRed.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Single letter variable names are very useful as loop counters, or in small utility functions where the functionality is obvious. They have their place and should not be discounted
Yes, using single letter variables in loops is justifiable because its standardised but single or double letter names using in functions or variables which are spread across files should be avoided because of it cannot be searched easily. Even for utility functions, names should be clear enough to understand what the function does.
Sorry, but I disagree. This function gains nothing by 'meaningfully' naming the parameter:
I've been writing code for about 38 years - 27 of those professionally. Experience has taught me that the best code is succinct and clear. It really isn't necessary to give everything a meaningful name - especially when the context makes it perfectly obvious what things are, and what they do.
Overly verbose code is exhausting to read, and totally unnecessary
Sorry, if I came across as unclear or rather misunderstood your point. But I totally agree to what you just mentioned. What I was referring to was the name of the function and not the parameters, in this case being isItemRed.