News for hackers. Stuff that matters.
Re:What science says about naming in programming by ape4 on Sunday January 08, 2017 @11:05AM (#13350297)
'name' is the one worst variable names possible. Its like calling your program 'program', your function 'function'. There is always a better choice.
Re:What science says about naming in programming by lallysingh on Sunday January 08, 2017 @11:25AM (#13350426)
Depends on the context. If other vars are 'addess' and 'phoneNumber', 'name' looks pretty reasonable.
Re:What science says about naming in programming by masklinn on Sunday January 08, 2017 @12:02PM (#13350644)
Hardly.

Is it a person's full name? legal name? first name? last name? nick name? desired call name? a company name? the name (alias) of the stored address?

Re:What science says about naming in programming by TeMPOraL on Sunday January 08, 2017 @12:54PM (#13350938)
If you're digging into that specific meaning of the word "name" (as a property of a person), you're likely doing something wrong:

http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-b...

Re:What science says about naming in programming by masklinn on Sunday January 08, 2017 @01:43PM (#13351198)
> If you're digging into that specific meaning of the word "name", you're likely doing something wrong:

If you're not you're definitely doing something wrong.

> (as a property of a person)

The original comment does not specify that it's "a property of a person". It could be a company, it could be a non-specific delivery address, etc...

Re:What science says about naming in programming by gohrt on Sunday January 08, 2017 @12:24PM (#13350782)
legal name in which country? name order varies between UK and China. What's a "call"? Whose company? what kind of address?

Following this line of thinking, communication is impossible because everything is ambiguous.

Re:What science says about naming in programming by masklinn on Sunday January 08, 2017 @01:45PM (#13351209)
> Following this line of thinking, communication is impossible because everything is ambiguous.

And making everything as ambiguous as possible makes communication easier… how?

Re:What science says about naming in programming by rbonvall on Sunday January 08, 2017 @11:25AM (#13350431)
When I taught programming to freshmen, the example I used to use when they called variables "number" or "string" was: "that's like calling your baby 'baby'."
Re:What science says about naming in programming by jstimpfle on Sunday January 08, 2017 @12:42PM (#13350880)
People do that and in many situations it's the most suitable choice.
Re:What science says about naming in programming by jstimpfle on Sunday January 08, 2017 @01:12PM (#13351039)
Why would anyone downvote this? Without any comments? Did you never say or hear "the baby is crying"?

I will now end my concern about being downvoted and get a life. The discussion culture in this thread is mad.

Re:What science says about naming in programming by rbonvall on Sunday January 08, 2017 @06:30PM (#13352768)
I didn't downvote, but what I really meant is "giving your baby the name 'Baby'".
Re:What science says about naming in programming by jstimpfle on Sunday January 08, 2017 @06:53PM (#13352910)
Very fair - thanks for the update. Maybe it helps to think not as giving variables fixed names (like Luke or Lisa) but seeing them as data accessed by descriptors that describe their qualities (the ones that matter in the current context).

Btw humans also have many names, depending on context. You might have had funny nicknames in your childhood, your friends speak to you by your first name, other might speak to you by your last name, others might call you "darling" etc... likewise it's also not totally uncommon to speak to babies by the handle "Baby", like "how are you doing Baby?".