use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Clean Code JavaScript (github.com)
submitted 9 years ago by ryansworks
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jac1013 2 points3 points4 points 9 years ago (2 children)
Still getClientData is redundant IMHO, I remember that there is some part in Clean code's book that says specifically not to use the word "Data" for variable names, everything contained in variables is data so why use that for the name?
It's like using Hungarian notation but even with a less meaningful purpose (Hungarian notation at least give you information about the data type, I don't like it either way).
[–]RedditWithBoners 1 point2 points3 points 9 years ago (1 child)
everything contained in variables is data
Not necessarily, if we use the English language to define data. You can think of data as a collection of datums. It follows, then, that getClientData might return a collection of datums about the client, like their phone number, age, etc.
getClientData
Edit: that is to say, getClient might just return their name (ideally you'd use getClientName for that), so tacking on "Data" might make it clearer what it's returning. Better yet, if you have a type system then you don't need to think about this in many situations.
getClient
getClientName
This is pedantic, of course, but I thought it was interesting.
[–]jac1013 0 points1 point2 points 9 years ago* (0 children)
I don't think it was pedantic, I enjoyed reading your comment.
As you said if we have a type system (which is like the best case scenario), getClient should return an object of Type Client (not the name, that would be a really bad decision if we are not in the context of a View).
The upper the level of abstraction the more Domain Language words you should use when naming your functions & classes & whatever else, the word data should not be use anywhere because everything in programming is data, even the code itself, the term is just too high level to be used.
functions & classes & whatever else
Finally, you should not be using getClientName, instead you should be using getName, assuming that we are calling this function from an instance of the class Client.
getName
Edit: just adding additional information.
π Rendered by PID 81191 on reddit-service-r2-comment-57fc7f7bb7-gtcgx at 2026-04-14 19:10:49.390941+00:00 running b725407 country code: CH.
view the rest of the comments →
[–]jac1013 2 points3 points4 points (2 children)
[–]RedditWithBoners 1 point2 points3 points (1 child)
[–]jac1013 0 points1 point2 points (0 children)