程序员的暴力美学

时间:2022-05-06
本文章向大家介绍程序员的暴力美学,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

调试程序是件闹心的事。尤其是你坐在那里几乎不动,在屏幕上苦苦工作了好几个小时,才发现这狗日的内存泄漏不是你的问题,而是某个浏览器(或者别的什么应用)。为了形象一些,我们暂且当这个浏览器是firefox(sorry firefox),你是不是有抄起一把AK47,把它打成筛子的冲动?

神马,手上没有武器?那就温柔一点,爆爆粗口?于是你在shell上敲了如下脏话:

fuck you - you ruined my day, firefox

可是shell温柔地回复你:"zsh: command not found: fuck"。郁闷!

前几天,我关注的大神mttn fork了robotlolita的一个repo:fuck-you。使用如下:

安装很简单:npm install -g fuck-you,然后就可以随心所欲地对着你不爽的进程,发出最狠毒的谴责。

$ fuck you - you ruined my day, firefox

 (╯°□°)╯︵xoɟǝɹıɟ (x1)

受此启发,mttn搞了个 go to hell <process_name>。玩fuck you玩到厌倦了,可以这么跟你的应用程序唠唠嗑:

go to hell iTunes go to hell bastard rabbitmq

有时候其实不全是应用程序的错。干活干累了,你自己的手脚都不太听大脑的指挥,本来是要敲git push,结果一不小心敲成了gti push,结果还得浪费时间重敲一次,是不是很想扇自己一耳光?

先别忙扇耳光,rwos的神器gti前来救驾:

看到这里,你可能会想,程序员们是一群什么样的家伙啊!

呵呵。

怎么说呢?作为程序员,我们很可怜,可怜到只能用飞速敲击的命令和冰冷的机器抗争;我们也很可爱,写出来的注释满满的都是爱。我们用自己独特的方式诠释着程序员的暴力美学。

看看这些奇葩的代码注释。

看过vsprintf.c的人想必都对这句注释有印象:

/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. / /

  • Wirzenius wrote this portably, Torvalds fucked it up :-) */

写代码写成了童话/科幻故事:

long long ago; /* in a galaxy far far away */

这段代码需要上帝保佑:

//When I wrote this, only God and I understood what I was doing
//Now, God only knows

请叫我傻瓜:

//This code sucks, you know it and I know it.  
//Move on and call me an idiot later.

没事干点恶作剧:

#define TRUE FALSE
//Happy debugging suckers

谨以此代码献给我老婆:

// I dedicate all this code, all my work, to my wife, Darlene, who will 
// have to support me and our three children and the dog once it gets 
// released into the public.

我很可怕,但我速度很快:

/* These loops are O(scary), but seems quick enough in practice. */

代码读不下去了,可生活还得继续:

/*
 * You may think you know what the following code does.
 * But you dont. Trust me.
 * Fiddle with it, and youll spend many a sleepless
 * night cursing the moment you thought youd be clever
 * enough to "optimize" the code below.
 * Now close this file and go play with something else.
 */

这代码我不负责,那些坏蛋逼我写的:

// I am not responsible of this code.
// They made me write it, against my will.

写给未来的自己的忏悔书:

//Dear future me. Please forgive me. 
//I can't even begin to express how sorry I am.

臣妾做不到啊:

// I have to find a better job

最后,我最喜欢的一条:

// hack for ie browser (assuming that ie is a browser)

谨以此文献给程序员们的另一半,他们的工作真心不容易,需要你的关心和呵护。:)