Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
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.
-
@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. -
tahnik387587y@IllSlapU it did not warn me. See the explanation by @Gatgeagent.
@appinv not an IDE. VSCode
@jamesharrington it's c++, not JS. -
World29687yThis 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.
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
-
sam966911Hats off to this lady .... I would have just flipped the machine
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.
rant
plus equal
c++
equal plus