DEV Community

Discussion on: Clean Code Part 1: Meaningful Names

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

Sorry, but I disagree. This function gains nothing by 'meaningfully' naming the parameter:

const isItemRed = i => i.colour == 'red'
Enter fullscreen mode Exit fullscreen mode

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

Thread Thread
 
tanisha03 profile image
Tanisha Sabherwal

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.