Linux Kernel Code Humor
An anonymous reader writes "This article points to some pretty funny comments and code in the Linux kernel. From colorful metaphors, to burning printers, to happy meals... A recursive search through the entire code base reveals some interesting language. Is all code like this?"
I actually think there's probably plenty of "Fuck Clippy" messages in Microsoft code, and they won't release it because it would show how much they hate themselves.
The developers in Microsoft can be quite at odds at the organization itself, like in any company...
+1 Insightful, -1 Troll. What can I say, I'm an Insightful Troll.
No comments at all are (rightly) far more likely to get you fired.
Roving Web-Teleoperated Robot
Don't use comments at all. Then, use lots of pointers and pointer math. Instead of just plain old:
Try
I'm sure you can manage lots of other great examples.
Some of us have jobs that involve writing well documented code in a workgroup, towards a specific goal. Not trying spending the day playing with the gimp writing kewl themez for xmms.
Of course the most famous of all is the comment in the task switching code of the original v6 Unix (Lyons commentary era) which said ... /* You are not expected to understand this */
And, of course, it means something like "this won't be on the exam". See Odd Comments and Strange Doings in Unix for more of this kind of fun.
Unless the spurious commenting actively obstructs maintenance -- and it's hard to imagine how it could do that -- it's perfectly fine if it's funny, witty, or (gasp!) off-task. Work is done better by those who enjoy themselves doing it.
The Mongrel Dogs Who Teach
Companies which lay people off, then let them code for the remaining 2 weeks are pretty naive. The last thing you want in your system is a pissed off coder.
I'd rather have a hacker in my system than an angry coder any day. They should get a clue.
-- Good judgement comes with experience. -- Experience comes with bad judgement.
The saddest thing is that the managers will never understand that they're responsible for their own problems. There are a lot of valid reasons for easing somebody out of the door, but the style of comments acceptable at the company before the merger is not one of them.
// workaround, some_library_call() isn't working like advertised
// fucking windows refuses to allow us to keep both widgets visible at the same time, so we'll do this instead...
N.B., I am not defending comments that are abusive to coworkers, slanderous, etc. That type of language has no place in an office.
But the tone of a comment is a valuable indication of how much effort was put into fixing it. If I see a comment like
it tells me that they RTFM but found a workaround. Maybe a future version of the library (or the FM) will get it right. I probably don't need to talk to the author before touching the code myself. In contrast, a comment like
tells me that they put a lot of effort into finding a solution to the problem, but every attempt failed. If I have an idea, I should talk to the author to see if he's already tried it. (Better yet would be a pointer to some internal document detailing everything they tried.)
This isn't absolute - many people will never let their comments contain any emotional tone, and others will swear at the slightest problem. But it's a valuable tool when it's used properly.
(Speaking of bugs, why does slashcode insist on merging paragraphs?)
For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
The differnece between "12 hours working on it" and "12 hours fsking with it" shows how difficult the problem was to solve, and as far as I'm concerned could be useful to someone else looking at the code later. Leaving it in is only an option with code that stays in-house I guess.
Follow me
Not pointless. It's saved in a static variable so glGetString and strcmp are only called once, even if the function is called a million times.
I control the time!
Humor can co-exist with professionalism. However, source code is not where you put it. If you ever release that code to a customer, it could damage your company's reputation. Too many such comments could interfere with efforts to search the source code. Humor also often language- and culture-dependent, so your company's foreign employees may even misunderstand subtle jokes as actual useful comments about the code. And then it's no longer funny.
Not to say that many such coding standards are little more than power trips. However, a professional will always keep in mind the fact that the source code doesn't belong to him or her. If you don't like the rules set by your employer, find another job.