Hi everyone,
This is a general question. I wanted to know from your experience which typos are the hardest to find or debug in your code. A back story would be nice :)
Thanks!
Hi everyone,
This is a general question. I wanted to know from your experience which typos are the hardest to find or debug in your code. A back story would be nice :)
Thanks!
Many people find that the equality operator in C/C++ is a real pain, because it can be easy to typo/confuse to be the assignment operator:
if(grade = 16)
{
}
vs
if(grade == 16)
{
}
They have so much problem with this, that there is an idiom to avoid this problem:
if(16 == grade)
{
}
...because the compiler would catch the typo.
I have Cyrillic keyboard installed on my computer which I switch to using Shift+Alt. While I was typing my code I accidentally switched to Cyrillic and typed a variable name using a Cyrillic character which looked very closely to an ASCII character. It took me a while to understand why my code wasn't compiling.
As it was a short snippet and I couldn't find the reason of not compiling I decided to rewrite it and imagine how surprised I was when it worked. I saved the working version to a new file and typed a few CTRL+Z to get the previous version which once again looked the same but it didn't work. Only when I performed a binary comparison on the two files I understood what the problem was.
I'll start things off just to get the ball rolling.
When working for one of my previous employers, we had a big release scheduled at a major telecom client aboard.
Because we added many new features and it was a relatively new system we did many tests and a long QA process and were anxious towards the release.
When we were convinced everything was WAD, we sent our integration team to install the product at the clients telecom system.
Once installed, all hell broke lose the clients systems failed all servers stalled and nothing went online.
The management went into panic mode, angry emails to the team leader and the developers people who were involved directly with the new features were flown abroad to the client to try and debug / appease the enraged telecom provider. The client was losing millions for each day his system was down...
At some point all developers started to feel like they're gonna get axed. If you receive an email from the VP of a 5000 employee company mailed directly to you asking for explanations then you know it can't be good.
At the end the problem was found, the cause:
At the JVM properties you can define the size of the heap before garbage collection is called, the integrator that installed the system typed 1024*k* instead of 1024*m*
which caused all the machines to go into constant GC and die.
That single letter caused my company about 4-6 Million $
Enjoy