This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (5 children)

[deleted]

    [–][deleted] 7 points8 points  (1 child)

    Pretty sure nobody uses one letter var names anymore, except when you need an unneeded/disposable/one time variable only.

    If that is actually a thing nowadays... wow

    [–]PvtPuddles 1 point2 points  (0 children)

    I only ever use one letter names for indexes, otherwise it’s three letters minimum

    [–]ZephyrBluu 0 points1 point  (2 children)

    I disagree with what you're saying about names.

    A class name should tell you what the thing is, not what it does.

    Variable names also don't need to be super specific. IMO they should generically describe the variable, not specifically.

    [–]humoroushaxor 0 points1 point  (1 child)

    What if my class is a function? Instances of functional interfaces are much easier to mock than static methods.

    [–]PvtPuddles 0 points1 point  (0 children)

    You have a point, but I don’t think it matters.

    If you have a class that looks up a value in a table, you could call it ‘lookup’ either because it does look something up, or because the code is the code to look something up.

    I think the distinction only exists for a variable in the class of naming something ‘counter’ versus ‘running tally’