OMG code :(
Aug. 16th, 2019 05:09 pmWho writes code that does:
Over and over again.
Maybe the same person who writes code that does:
Or does:
// that should be one line:
I am in pain. So much pain.
sprintf(buf, "this is a constant string"); strcat(str, buf );
Over and over again.
Maybe the same person who writes code that does:
int cksum = 0; // this is really simple // just add all the bytes, modulo the MAX storable value // in the cksum for (i=0; i < len; i++) cksum += buf[i];
Or does:
msg.flags = 0;
if (flags & FLAG1)
msg.flags = FLAG1;
if (flags & FLAG2)
msg.flags |= FLAG2;
if (flags & FLAG3)
msg.flags |= FLAG3;
if (flags & FLAG4)
msg.flags |= FLAG4;
// that should be one line:
msg.flags = flags & (FLAG1|FLAG2|FLAG3|FLAG4);
I am in pain. So much pain.