Live data from Hacker News

Things to commit just before leaving your job

gist.github.com

131–140 of 165 posts

Re: Things to commit just before leaving your job

#131

Wouldn't it be wise if the compiler (or preprocessor) issued at least a warning if you redefine language keywords ? :) So I just pasted this into a C++ file I was working on and it compiled without a single warning: #define struct union #define if while #define else #define break #define double float #define volatile // this one is cool I mean, redefining language keywords is not a thing I do every day and I guess mo…

No warnings is the whole point.

My c++ isn't so good that I understand that first one, but if->while and break->"" can introduce infinite loops, else->"" will break logic (and possibly hit null pointers), double->float will cause subtle rounding errors in numeric computation, and volatile->"" will break multi-threaded apps unpredictably.

It's evil, subtle code breakage that because of the macro (in an included header far far away) leave the code looking perfectly ordinary.

Re: Things to commit just before leaving your job

#133
post #118

Perhaps we now finally know the story behind this: https://code.google.com/p/android-source-browsing/source/dif... "probably can live undetected quite long" indeed...

So memset was crippled from Android 1.5-2.1? How did this not bring everything to a grinding halt? (Not familiar with Android's inner workings specifically, but from a C standpoint this sounds major.)

Re: Things to commit just before leaving your job

#134
post #73
post #49

I would suggest before you leave your job, you say "it was nice working with you" to the people you liked working with, and absolutely nothing to those who you did not enjoy working with. The tech world is big in some ways, but also equally small in others. A select few might find this funny, but others will not appreciate their day (or longer) spent debugging your practical joke...and on the chance you actually get…

And if you do a code change, make sure it is really funny, is easy to fix and discover and is invisible to customers. Like, inject a hilarious joke into the log files or something.

Right before leaving my last job, I updated an internal web-based tool to add a menu item called "Add Unicorns." It just used cornify to show unicorn images when clicked. But I also made it only show that menu item at random and somewhat rarely, so I heard that it took some people a while to notice, which was fun. To my knowledge, that change is still there!

Re: Things to commit just before leaving your job

#135

Earlier quoted context omitted.

My god, i'm surprised that person didn't land up in court :/

Is that illegal though? Sure, if you can PROVE it is done on purpose then maybe, but assuming you cannot then is it? Because if it is then any misconfigured version control or any employee that doesn't do what is expected of them is also breaking the law.

I'm not a lawyer but isn't provability kind of orthogonal to legality?

Re: Things to commit just before leaving your job

#136
post #133
post #118

Perhaps we now finally know the story behind this: https://code.google.com/p/android-source-browsing/source/dif... "probably can live undetected quite long" indeed...

So memset was crippled from Android 1.5-2.1? How did this not bring everything to a grinding halt? (Not familiar with Android's inner workings specifically, but from a C standpoint this sounds major.)

How often is memset used to set the data to something other than zero? Probably even less often than strncpy copies a string that is exactly the length of the destination, I'd wager :)

That is the evil genius of this bug.

Re: Things to commit just before leaving your job

#137

Earlier quoted context omitted.

Not some - all* US jurisdictions. From the Computer Fraud and Abuse Act (18 U.S. Code § 1030(5)(A)): >knowingly causes the transmission of a program, information, code, or command, and as a result of such conduct, intentionally causes damage without authorization, to a protected computer

English isn't my first language, and I don't live in America so it's not like this matters to me, but now I'm curious. How is editing a source file you're meant to be editing "transmitting" anything?

If there's a remote server involved (your VCS?) it's transmission.

Given the occasionally draconic application, if there is a signal (did you use a keyboard?) then it's transmission.

Re: Things to commit just before leaving your job

#138

Wouldn't it be wise if the compiler (or preprocessor) issued at least a warning if you redefine language keywords ? :) So I just pasted this into a C++ file I was working on and it compiled without a single warning: #define struct union #define if while #define else #define break #define double float #define volatile // this one is cool I mean, redefining language keywords is not a thing I do every day and I guess mo…

[deleted]

Re: Things to commit just before leaving your job

#139
post #107

Earlier quoted context omitted.

It's the correct advice, but I'm sure 99% of people reading this are seeing it as simply a joke. For the other 1% see above.

(author of the gist...) Anyone really thinks it's not a joke? This was all a few years ago, but IIRC the original thought behind it was something I saw on twitter, or perhaps just pondering how evil can C/C++ preprocessor could possibly be.

Don't feel too bad, people who are genuinely considering this are likely vindictive enough to deserve getting black balled.
Post reply on HN