Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hm. Use one letter variable names for scoped variables? Excerpt from lines 92-112:

"* The length of an identifier determines its scope. Use one-letter variables for short block/method parameters, according to this scheme:

    a,b,c: any object
    d: directory names
    e: elements of an Enumerable
    ex: rescued exceptions
    f: files and file names
    i,j: indexes
    k: the key part of a hash entry
    m: methods
    o: any object
    r: return values of short methods
    s: strings
    v: any value
    v: the value part of a hash entry
    x,y,z: numbers
 
  And in general, the first letter of the class name if all objects are of that type."


This is explicitly disallowed within some companies...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: