horror code, optimization needed Horror Code - Who Needs Enumerators? When I stumbled into this piece of C code, at first, it looked not so bad to me. void foobar(const char *par) { if (!strcmp(par, "FirstString")) { // do something } else
horror code Horror Code - Copying & Pasting Errors The following piece of code contains a trivial error... twice. int v; char buf[11], *p; memset(buf, 0, sizeof(buf)); /* Fill buf with a string */ v = strtoul(buf, &p,
working life, horror code, optimization needed Horror Code - Loop And Re-loop Some time ago, a colleague of mine told me to look at a function. It was something similar to this: void foo(struct bar array[], unsigned int count) { /* some initialization
C, horror code Horror Code: Paid By The Number Of Rows The first thing I've thought is: "I'm missing something". But after few seconds the doubt that the author of the following code is paid for the number of lines of
horror code, optimization needed Horror Code - Why? When I have found the following snippet, I spent several minutes trying to understand if I was missing something. while (x >= 0) { x--; y--; } I have only a question: why?
personal, horror code Horror Code: The Matryoshka Functions Some years ago, when I was a Windows developer, the maintenance of a big project has been assigned to me. My job was to fix a couple of minor bugs
development, personal, C, horror code Horror Code: the Impossible Function This is one of the less readable functions that I've found in my life. I've removed any reference to structures and variable names, according to the Italian law about privacy