19

TFW you’ve been trying to debug an issue for over an hour and you find out you typed:

variable1 == variable2

Instead of

variable1 = variable2

AARRGGHHHHJJHHHHHRIFNRIDKEJXJDJ!!!!!!!

Comments
  • 0
    Just do your motherhumpin' unit-tests!!!!
  • 1
    @TylerDDevRant don’t have time for unit tests, am doing a code test
  • 0
    @queekusme
    In this case, time is an illusion.
    Unit-tests are saving your time on a daily base.
    No nasty bugs appear, you have to spend your time on.
    Adjusting the code in a way it will change your expected results will break your tests and you can instantly recognize and fix the possible bug.
  • 1
    Usually, the compiler should have warned you?!

    GCC will issue a warning "statement with no effect" if you use -Wall, which is always recommended (and also -Wextra on top of it). Together with -Werror, it will treat the warning as error so that the compilation will fail.
  • 1
    @Fast-Nop visual studio, so no error checking...
  • 1
    @queekusme See here: https://msdn.microsoft.com/en-us/...

    /Wall and /WX are the equivalents.
  • 1
    In fact it happened to me in the other way:

    while(var1 = var2) //infinite loop :(
  • 2
    @LuxARTS I think that’s more frustrating tbqh
  • 0
    I had similar the last 2 days although I wasn't working on just one project so just sorta a bug I eventually needed to fix.

    Well I happened to be making some edits and cleaning the code then stumbled on the source of the problem....

    An extra , in an json array...
Add Comment