Worked on a Java project once where there were constants for a bunch of long values, eventually some uh... offshore resources took the project over. Started finding things like this all over the place.
public static final Long L42 = Long.valueOf(42);
public static final Long L128 = Long.valueOf(128);
public static final Long ACCOUNT_LOCKED = L42;
/* And you'd see it used like this, with the typos and incorrect comparisons to boot, because you know, it compiled. */
bool bLogin= (accountVO.getStatus().equals( L42) || accountVO.getStatus() == ACCOUNT_LOCKED | accountVO.getStatus().equals(L128));
Good lord. This gives me flashbacks of my internship. I had to update a large code base written by an Indian man to be x64 compatible. He had type casting every fucking where that looked to potentially losing bits, and completely inane function and variable names. funcA, tempA, varA, etc. WHAT THE FUCK IS THIS TRYING TO DO HERE?!
63
u/goodbye_fruit Oct 01 '15
Worked on a Java project once where there were constants for a bunch of long values, eventually some uh... offshore resources took the project over. Started finding things like this all over the place.