DEV Community

loading...

Discussion on: Stop Using "data" as a Variable Name

Collapse
toddpress profile image
Todd Pressley

Thank you for articulating this in your own way and publishing :) This topic reminds me of something a favorite mentor once taught me, when confused about naming a particular function:

"If you're having trouble naming a function, then it's most likely doing too many things."

Years later, when encountering similar issues, I play this back in my head and have found it very useful. It can be expanded to naming just about anything.

Again, love the article!

Collapse
dcwither profile image
Devin Witherspoon Author

Thanks for sharing! That’s a great angle to look at it from. I love that quote, I’ve definitely encountered that scenario many times both as a reviewer and an author.

Given people seem to have appreciated this article, would you mind if I expand on this in the future along the lines of “X reasons why you might be struggling to name something”?

Collapse
toddpress profile image
Todd Pressley

That'd be awesome, man! Not at all!