24
davide
7y

What do you prefer?
a) if (var1 != var2)
or
b) if (!(var1 == var2))

Comments
  • 30
    a, definetly a!
  • 4
  • 8
    a. It's very easy to miss the ! to the left of the parenthesis. != stands out.
  • 10
    a !
    why would you even write b ? 🤔
  • 43
    if(var1 == var2){}
    else {
    //do stuff
    }

    Get on my level bois! 😎
  • 1
    @Alfer 😂😂😂
  • 3
    @Alfer
    well, you do a check for nothing 🤐

    but you give me an idea, if you can:
    if (var1 == var2)
    return
  • 13
    I am not a criminal.
    Or
    It is not true that I am a criminal.

    Which one is better?

    a) sounds more natural and innocent

    b) most people think he is an criminal, but he claims that is not true

    So depends on your scenario

    Takes Justin Birber as an example:

    a) JB: I am not a developer
    (This is obvious so just say it directly)

    b) JB: It is not true that I am a gay.
    (Well.... suspicious... then he has to stand against the public opinion)
  • 9
    My approach:

    #define false true

    for (size_t i = 0; i <= 666; i++)
    {
    if (!( i % 666 == 0 && var_1 == var_2))
    {
    // Code
    }
    }

    Just let it iterate through a loop first for no reason
  • 0
    It's supposed to be c/cpp fyi
  • 12
    If anyone says "b" I challenge him/her to a duel with pistols at dawn

    That kind of people should not be allowed to code
  • 2
    @simus "useless" is my second name 😎 "cunt" is the third, but that's irrelevent 😐
  • 4
  • 1
    Definetly a, but something like so would work:

    if (not(var1== var2))
  • 1
    int valueOfVar1 = var1;
    int valueOfVar2 = var2;

    if (valueOfVar1 != valueOfVar2 ) {
    if (var1 != var2) {
    if ( (valueOfVar1 != var2) && (var1 != valueOfVar2) {
    // Insert your code
    }
    }
    }
  • 9
    if(
    !(!(!(!(!(!(!(!(var1 !=
    var2))))))))){}
    else
    {
    print("Fuck you");
    }
  • 0
    a. With b you have to evaluate the condition twice. It's also takes extra milliseconds to read.
  • 0
  • 0
    definetly a
  • 0
    Nope, I'd go with
    Boolean(!( a === b))
  • 0
    I prefer...
    B==> O

    Just looks cleaner.
  • 1
    switch(a){
    case b:
    break;
    default:
    //your code

    }

    At least that's the way I do it 😜
  • 0
  • 0
    if [[ var1 != var2 ]]; then
    # Stuff
    else
    # Other stuff
    fi
  • 0
    @dontPanic what does # define true false do?
  • 0
    @inukinator from what I remember it either switches true and false of makes every true false XD
  • 1
    @inukinator alright I checked and #define false true redefines false statements to true ones
  • 0
    @DeepSpace If you hadn't mentioned it I wouldn't even have seen it 😐
Add Comment