News for hackers. Stuff that matters.
Re:Long Names are Long by burkaman on Friday June 17, 2016 @11:20AM (#11923146)
Why?
Re:Long Names are Long by Larrikin on Friday June 17, 2016 @11:59AM (#11923398)
3 extra characters to make the variable user takes no time and makes the code clearer
Re:Long Names are Long by conistonwater on Friday June 17, 2016 @12:06PM (#11923450)
Does it actually make the code clearer, though? If u is used as a temporary local variable meaning a user from users throughout the code, I think it's quite clear. Consistency seems like the important thing here.
Re:Long Names are Long by choward on Friday June 17, 2016 @12:14PM (#11923501)
> If u is used as a temporary local variable meaning a user from users throughout the code

Until it isn't. How do you enforce this?

"Please use descriptive variables everywhere, except for when you are iterating over a list of users. Use "u" in that case. Thanks."

Re:Long Names are Long by akavi on Friday June 17, 2016 @12:51PM (#11923713)
"Please use variable names that are more descriptive the larger the scope of their use is."

When the scope is limited to a single line lambda, "first letter of the thing it is" is plenty descriptive enough, especially given that it's a strong convention in ruby.

(In an example of the opposite extreme, I'm currently working int codebase where every non-function local/non-instance variable has to use its fully qualified path name. Extremely descriptive; extremely unreadable.)

Re:Long Names are Long by yongjik on Friday June 17, 2016 @02:51PM (#11924741)
In the same way you enforce anything else: common sense.

The other direction is the same. If your team doesn't share a "common sense", then someone will end up writing value[axis_x][axis_y][axis_z], because single-letter names are prohibited.

Re:Long Names are Long by icebraining on Friday June 17, 2016 @12:53PM (#11923731)
All names depend on context. "user" may or may not be description depending on the surrounding context. Single-letter variables are the same.

Your own post provides good examples - you use "it" and "this" because, in context, they are clear and easier to write and read than a longer version.