214
tahnik
7y

After an hour of debugging, realised that I wrote =+ instead of +=.

I will just to go in a corner and cry for a minute. brb guys.

Comments
  • 4
    I feel you... Want a tissue?
  • 2
    what IDE?
  • 3
    Both are valid in js (if thats the lang your using) I suggest a formatting standard. Infact the format named standard is really great. It will help you catch stuff like that in the future.
  • 15
    @IllSlapU
    variable += 1
    Compiler says nothing, variable will be increment by one normally, not an error of any kind.

    variable =+ 1
    Can be seen as "variable = +1", variable will be set to 1, no syntax error, whatsoever.
  • 3
    @IllSlapU it did not warn me. See the explanation by @Gatgeagent.

    @appinv not an IDE. VSCode

    @jamesharrington it's c++, not JS.
  • 1
    @tahnik try netbeans for cpp
  • 0
    This one guy asked me to debug his code. Apparently he didn't put braces after a for loop and expected the compiler to read his mind. After I told him to correct it, he wrote the braces first and put the looping condition inside the braces.

    In his defense, he is just learning and not a CS student.
  • 0
    Wow, dumb language, dumb tools.
  • 1
    @Hastouki
    Nah, just dumb tools. A decent compiler will warn you.
Add Comment