Things to commit before you quit your job
gist.github.com
gist.github.com
And then twitter conversation went to more and more evil suggestions. I just captured them in the gist.
My favorites are "#define strcpy(a,b) memmove(a,b,strlen(b)+2)" - which can go unnoticed in a long, long time; and "#define InterlockedAdd(x,y) (*x+=y)" - which would be total hell for someone to debug, as if lockless programming wouldn't be hard enough already.
I don't think that's true:
struct foo {
int a;
int b;
};
char arr[sizeof(struct foo) == sizeof(int) ? -1 : 1]; #define if(x) if ((x) && (rand() < RAND_MAX * 0.99))
its pretty awesome. I'm a fan of: #define == =Here's an old gem I came across a few years back:
https://gist.github.com/bsamuels453/5819204
This is a bitch to detect if you have a huge project. The #ifndef _DEBUG is like frosting on the cake. Templates are truly C++'s greatest 'gift'