rmd: (fuck-logic)
rmd ([personal profile] rmd) wrote2013-08-20 10:26 pm

It's ... it's beautiful. And evil.

Via [livejournal.com profile] solarbird's recent post, this is delightfully evil - suggestions for evil things to commit just before a big code commit (the comments are actually readable and amusing, too)

Examples:
#define struct union
#define if while
#define true ((rand()&15)!=15)
#define if(x) if ((x) && (rand() < RAND_MAX * 0.99))
ceo: (code)

[personal profile] ceo 2013-08-21 03:05 am (UTC)(link)
I'm going to hang onto this to show people when they try to persuade me that macros aren't evil.

[identity profile] deguspice.livejournal.com 2013-08-21 06:16 am (UTC)(link)
Years ago, I remember seeing a Pascal program that began

temp = true;
true = false;
false = temp;

[identity profile] adb-foldem.livejournal.com 2013-08-21 08:14 pm (UTC)(link)
You are going to hell.

[identity profile] prock.livejournal.com 2013-08-22 02:31 am (UTC)(link)
Far too obvious.

A much better MO:

1. Find an intermittent and vexing bug.
2. Ensure that the bug has not been reported in any issue tracking software.
3. Fix the bug, with obfuscated code which looks incorrect and buggy, but which is golden.
4. Develop unit tests to ensure that your buggy looking code does in fact fix the bug.
5. Throw away said unit tests.
6. Check in ugly bug fixing monstrosity alongside another commit relating to a different bug in the same code region.
7. Soon before leaving, "fix the buggy code" along side another unrelated bug fix, preferably in the same code region.
8. Develop unit tests to "demonstrate" that your patch does in fact fix the bug.
9. Check in your patch, the false bug fix and the other bug fix, and the unit tests in a single commit.
...
profit?
Edited 2013-08-22 02:32 (UTC)