if(b1[i]!=b2[2]) turnHairGray=true;
Any little bugs drive you nuts lately? I met up with one yesterday. It involved one tiny, seemingly harmless section of code that was comparing bytes in two byte arrays. I had just finished completing a series of changes due to a significant change in a backend database (database encryption of sensitive fields) that resulted in new field types (varbinary).
After I completed all of the necessary changes, I couldn’t get the application to test out. Further, it wasn’t behaving the same on all tests and driving me truly berserk. After checking/double-checking/triple-checking all of the sections and scenarios that I thought might be causing the problem I finally realized my error in a tiny innocuous looking method. My intended code was
if(b1[i] != b2[i])
instead I had entered
if(b1[i] != b2[2])
Motto of the story: bugs are equal opportunity creatures that appear in simple procedures just as much as complex procedures. This would make sense if it’s true that our level of concentration or thought effort is linear to the complexity of the procedure. Happy Holidays!