142
ohman
6y

The story of how humans evolved to an asshole.

Code-reviewer: please change 'if a==b' to 'if b==a' as it is easier to read so I can approve.

Code-owner: -_-

Comments
  • 31
    You: please take off your pants as it’s easy for me to fuck your ass.

    Code-reviewer: 🤒
  • 8
    For long A and short B, this makes sense. Also for variable A and constant B if Yoda expressions are part of the required coding style.
  • 3
    In terms of readable code :

    a = {}

    a manipulated....

    check_a = a.keys().__len__()

    if check_a > 0:
    return True
    else:
    return False

    Me be like .....

    return not a

    Then slapped by the ass.

    Sometimes reviewer so frustrating.
  • 2
    I think it’s time to create a comment bot which would reply “fuck off” every time it sees something as ridiculous as this...
  • 4
    How does that make it easier? unless for example:

    if (allowedBalance == userBalance)

    then ya I'd switch them just to reflect the case I'm checking which is, is user balance equals to allowed balance
  • 7
    B==D or D==B ? Would pick the latter
  • 11
    @trollonaboat I’d pick:

    (B == D || D == B)

    Just in case the reviewer doesn’t like one of them :P
  • 4
    in all seriousnes I thought the same until...

    if (david == shit)
    if (shit == david)

    made me realise that maybe David doesn't look like shit, it is just some shit that looks like him
  • 0
    I review code every day. That is not fair. It expresses a pure, personal preference which has nothing to do with coding standards or guidelines. It's not meant to be like that.
  • 3
    Dear code reviewer, would this work: B===D

    Let me know! (also, shove that down your fucking throat)
  • 0
    @Fast-Nop what are yoda expressions?
  • 3
    @GodlikeBlock "if (VALUE == myvar)". That is like saying "if strong is the force", which is how Yoda speaks.
  • 1
    @Fast-Nop I just don't get why yoda expressions are still popular. It's established that code is read more than it's written and yoda expressions are not readable. Any bugs these expressions try to avoid should be caught by simple testing if not source checker or compiler.
  • 1
    @dr-ant catching such a bug in testing or even with manual debugging is too expensive because the cost of bug fixing grows exponentially with the project phase.

    The compiler should warn on this indeed, but I guess not all of them actually do that. GCC requires double parentheses if you really mean a combined assignment and comparison against zero. Then again, many projects compile with tons of warnings (another no-go) so that the hot ones will go unnoticed.

    And of course, you don't get any warning in the browser console if you do "if (x = 1)" in JavaScript.
  • 0
    Add " B==D~ " ykwim 😉
  • 0
    That moment when you comment. Then go through other comments and see many same comments as you did. Lol
Add Comment