183

If you name your methods a, b, c, x, z, etc

Then I hate you.

If the idiot wants me to help then use proper method names!

Comments
  • 10
    Yes. Can I give you more than ++? Cause what you are saying is true and everyone should read this.
  • 10
    I haven't come across anything like that yet but I do see this in Java a bit too often:

    this.that.magic.thisThatDoMagic();

    😫😫😫
  • 2
    @Condor your loop has lot of moving parts my friend!! Switch to an internal iterator where ever you can!
  • 2
    yea the worst is when the test uses that stuff, some programming classes are a joke at my uni
  • 9
    @Michelle i have seen other end of spectrum in method making!

    getThisObjectAfterValidatingUserAgainstNewTypeOfAuthUsingCustomImplementationAndAsyncOperationNowIForgotWhatIAmDoing
  • 4
    I actually forgot the stack you're working on. If I remember it correctly, there was a JS rant a while ago. If you're talking about js, check out this project: http://jsnice.org it can help to make sence of (about?) shit code!
  • 6
    @Wack
    It was Java actually. I don't recall making a JavaScript rant. I'm pretty sure that was someone else.
  • 5
    @Michelle might be. There where a lot of then lately.
  • 2
    @Condor she said methods not variables
  • 4
    @Condor
    It's the same thing.

    Vague method, variable, and function names are all the same.

    It's all equally annoying. Though, this was my mistake. I should have used all three terms for clarification.

    My most sincere apologies.
  • 2
    How about just I and just for a small number of loops?
  • 4
    I used zo do this.

    It was the worst xD

    Picked up a four-year-old project and didnt understand anything.
  • 2
    @Condor method would be similar to function more than variable and you’d agree that naming a func with a letter is bigger sin than a variable.

    Also if you’d name your for loop iterator something longer than a letter I’d slap you, unless somehow (god knows why) you’re using more than 2 nested for loops and you need some clarification.
  • 5
    Depends on the language and context.

    In Haskell and Go variables are often single letters, because when they represent super abstract but idiomatic concepts it makes sense. In Go you continuously use polymorphic readers and writers, so you call them w and r.

    I think letters like i and j are often fine as indexes as well, especially when no other name makes sense because it's really just a generic, integer index. In many iterative languages they're so common that it's easy to read.

    It's all about idioms. If M is the idiomatic way to use a testing mock in a language, it will appear so often across the code that it will become semantically useful.

    It's a problem when you start calling methods "usr.dlt" instead of "user. delete" just for the sake of saving letters.

    And the worst sin: calling a method "product.setDescription" when it also calculates the vat percentage, sends a mail to an admin, and kills two random kittens.
  • 2
    Don't touch swift, I name those variables with emojis just to be a dick...
  • 2
    So you wouldn't help me in a good game of golf? :(
  • 5
    @w4tsn
    I don't know how to play golf so...

    No!
  • 2
    @Michelle I'm talking about code golf 😊 where it is a really good idea to use a,b,c as function names 😋
  • 2
    The the examples in the book for the data structures class at my school are full of this shit. Damn you Sedgewick and Wayne!
  • 3
    Happy Birthday ^_^
  • 1
  • 1
    I perfectly agree.
    When given proper and descriptive sometimes our teaching assistants suspect that we copied it. Like why???
  • 1
    Makes sense for some algorithms, e.g. to calculate Easter Sunday: https://dzone.com/articles/...
Add Comment