A lot of you have a lot of faith in people reviewing PRs. I know a few Sr. developers, that if shit was too busy, would skim it and say 'fuck it, it will be QAs problem. If you put this in the correct sub-system in file that would only be executed once a month, for example a maintenance class, It would be really hard to notice something is wrong if it didn't cause issues seen immediately. Maybe this is the story of an intern that added something that also fucked up boolean comparisons in a subsystem used once a month. Where there is a 2 week lag between the execution and operations noticing something wrong.
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
{devs} would skim it and say 'fuck it, it will be QAs problem.
And then delays until code complete would eat up all of QA's time so they have no real time left to test before app release into production.
Lol I don't think the preprocessor would be too happy with a space after #
C preprocessor wouldn't care about it
Lol that's news to me!!
Is this some simple line of code that just shuffles everything around in file storage areas?
This looks like a C macro. Basically what it does is replaces the word "true" in the code with (rand() > 10). The rand() function will return a random number from 0 to 32767. So (rand() > 10) will very likely return "true" but not always.
So say you have some code like this: if (someVar == true) { // Do stuff } It would replace "true" with code that usually evaluates to "true" but not always. So every so often your code would just do the wrong thing but it would be hard to debug because it would be rare.
Granted, in that example you probably would just write "if (someVar)" making this moot, but there are more realistic cases where you'd use the constant "true"
rand()
generates a number from 0 to a constant defined in stdlib, which usually corresponds to the architechture of your compiler. So, for 32 bit systems (assuming all the software in the line is 32 bit, too) it will be 2^31-1 = 2 147 483 647, as 1 bit in integers is reserved for negative numbers and 1 number is 0.
Though, by design it is guaranteed to be at least 32767, which is a value for 16 bit integers.
Oh good to know. I googled it and got that 32767 number but it did say "guarantee to be at least 32767"
Funny but I call bullshit all day
Yeah, how did they commit this to anywhere that would hurt?
They did not ✌️
That happened 🙄