程序员最可怕的噩梦是什么
正文翻译
What is a coder's worst nightmare?
程序员最可怕的噩梦是什么?
What is a coder's worst nightmare?
程序员最可怕的噩梦是什么?
评论翻译
Mick Stute
This was mine:
I was hired by a psychologist to fix a program that seemed to have "strange output" written by one of his ex-grad students. It was a program that reads a data file, asks about 50 questions, does some calculations, and comes up with some score based on this PhD's research. It's on a research 3B2 at the university. He demonstrates the program and sure enough there seemed to be strange flashing words on the screen when it moves from question to question, and they don't seem nice. I agree to do it, should be pretty straightforward, so he'll pay me by the hour to determine how big the fix is and then we'll agree to a fee.
我先来说说我的噩梦:
一个心理学家雇我去修复一个程序,这个程序是他以前的一个研究生写的,这个程序最后输出来的结果有点奇怪。这是一个会读取数据文件、能提出大约 50 个问题、并进行一些计算,然后会根据这个博士的研究得出分数的程序。这是3B2的一项研究。他向我演示了这个程序,果然当它从一个问题移动到另一个问题的时候,屏幕上会闪烁一些奇怪的词,而且这次词看起来不太友好。最后我同意为他进行修复,因为我觉得这个问题应该很简单。他说先按小时计费,然后再根据修复的大小,最后再跟我商定具体的费用。
This was mine:
I was hired by a psychologist to fix a program that seemed to have "strange output" written by one of his ex-grad students. It was a program that reads a data file, asks about 50 questions, does some calculations, and comes up with some score based on this PhD's research. It's on a research 3B2 at the university. He demonstrates the program and sure enough there seemed to be strange flashing words on the screen when it moves from question to question, and they don't seem nice. I agree to do it, should be pretty straightforward, so he'll pay me by the hour to determine how big the fix is and then we'll agree to a fee.
我先来说说我的噩梦:
一个心理学家雇我去修复一个程序,这个程序是他以前的一个研究生写的,这个程序最后输出来的结果有点奇怪。这是一个会读取数据文件、能提出大约 50 个问题、并进行一些计算,然后会根据这个博士的研究得出分数的程序。这是3B2的一项研究。他向我演示了这个程序,果然当它从一个问题移动到另一个问题的时候,屏幕上会闪烁一些奇怪的词,而且这次词看起来不太友好。最后我同意为他进行修复,因为我觉得这个问题应该很简单。他说先按小时计费,然后再根据修复的大小,最后再跟我商定具体的费用。
Day 1
I sit down at the 3B2 and login to the ex-grad student's account that has been given to me. This is where the code resides. I examine the C code. It is written to be hard to read. All the code is squished on one line. It's spread over 15 files with about 3 functions per file -- all on one line. All variable names are just three, seemingly random, letters. I talk to the guy and agree to go with hourly on this (great decision). I untangle all the code and format it nicely so I can see it.
It was done on purpose. It used the curses library to move to a point on the screen, print a question and the answers, and wait for a response. But it first went to the first line of the question, printed some white supremacy message, waited 1/2 a second, and then overwrote it with the question. This ought to be simple. There are only about five places it could output anything, and all of them had this subliminal flash of a message. dexe the offending mvprintw() and all is well. Or should be. I compile, thinking I'm done. But when I ran it, there it is again -- the subliminal messages. This time with different text still the same subject, just different messages.
I check my code and believe it or not it's back to the initial state I found it. 15 files, mangled, 3-letter variables -- the whole thing right back where I started. I want shoot myself for not making a copy of my code. I unmangle again, this time putting it in three files, named differently. I make a copy of the whole directory, and I mark the files readable only. I compiled it. All looks good. I run the program. There's now a copy of the original 15 files in the directory along with mine and the subliminal messages are back.
Okay, so somewhere on the disk is the source code necessary to keep doing this and he's set the program up to pull in that code when you compile it. I do a full disk search in the include areas (/usr/include) and since this is a research version we have source for just about everything but the kernel itself. That's a lot of header files and this takes some time on the 3B2, so that's day 1.
第1天:
我打开了3B2 ,然后登录了他给我的以前研究生的帐户。这就是代码所在的位置。我检查了 C 代码,这个代码写得难以读懂,所有的代码都压缩到了一行里。它分布在 15 个文件中,每个文件大约有 3 个函数,而且这些函数还都在一行。所有的变量名都只是三个看起来很随机的字母。然后我和那个心理学家谈过了,同意在这个问题上按小时计费(这个决定做得非常好)。我解开了所有的代码,并把他们全部格式化了,这样方便我查看。
这个程序是使用curses库移动到屏幕上的某个点,再输入问题和答案,然后等待响应。但它是先到了问题的第一行,输入了一些关于白人至上的不实信息,然后等了 1/2 秒之后,又用问题覆盖了这个信息。当我发现这一点的时候,觉得这应该挺简单的,因为它可以输出内容的地方只有五个,而且这五个地方都有这种信息闪现。所以我删掉有问题的 mvprintw()以后,一切正常,或者说应该是一切正常,我以为我完成了修复。但是当我再运行它的时候,它又出现了那些不实的信息。这次虽然是不同的文字,但主题还是相同的,只是信息不同而已。
我又重新检查了我的代码,不管你信不信,这个程序又回到了它的初始状态。 15 个损坏的文件,3 个字母的变量,一切又回到了我刚开始的地方。我当时特别后悔没有把我的代码复制过来,我只能把代码再重新解开一次。我这次把它放在了三个文件中,并给它们编了不同的名字。我复制了整个目录,并将文件标记为只读。我开始修复这个程序,一切看起来都不错。现在在我的目录里有15个原始文件的副本,然后我继续运行程序,那些不当的信息又出现了。
所以说,在这个磁盘上有一个地方有继续执行此操作的源代码,并且他已经将这个程序设置为在编译时就引入该代码。所以我不得不将这个程序所包含的区域全都进行了完整的磁盘搜索,因为这是一个研究版本,所以我们拥有除了内核本身之外的所有源代码。这是一个很大的母文件,所以需要在3B2上花费一些时间,但这才第一天。
I sit down at the 3B2 and login to the ex-grad student's account that has been given to me. This is where the code resides. I examine the C code. It is written to be hard to read. All the code is squished on one line. It's spread over 15 files with about 3 functions per file -- all on one line. All variable names are just three, seemingly random, letters. I talk to the guy and agree to go with hourly on this (great decision). I untangle all the code and format it nicely so I can see it.
It was done on purpose. It used the curses library to move to a point on the screen, print a question and the answers, and wait for a response. But it first went to the first line of the question, printed some white supremacy message, waited 1/2 a second, and then overwrote it with the question. This ought to be simple. There are only about five places it could output anything, and all of them had this subliminal flash of a message. dexe the offending mvprintw() and all is well. Or should be. I compile, thinking I'm done. But when I ran it, there it is again -- the subliminal messages. This time with different text still the same subject, just different messages.
I check my code and believe it or not it's back to the initial state I found it. 15 files, mangled, 3-letter variables -- the whole thing right back where I started. I want shoot myself for not making a copy of my code. I unmangle again, this time putting it in three files, named differently. I make a copy of the whole directory, and I mark the files readable only. I compiled it. All looks good. I run the program. There's now a copy of the original 15 files in the directory along with mine and the subliminal messages are back.
Okay, so somewhere on the disk is the source code necessary to keep doing this and he's set the program up to pull in that code when you compile it. I do a full disk search in the include areas (/usr/include) and since this is a research version we have source for just about everything but the kernel itself. That's a lot of header files and this takes some time on the 3B2, so that's day 1.
第1天:
我打开了3B2 ,然后登录了他给我的以前研究生的帐户。这就是代码所在的位置。我检查了 C 代码,这个代码写得难以读懂,所有的代码都压缩到了一行里。它分布在 15 个文件中,每个文件大约有 3 个函数,而且这些函数还都在一行。所有的变量名都只是三个看起来很随机的字母。然后我和那个心理学家谈过了,同意在这个问题上按小时计费(这个决定做得非常好)。我解开了所有的代码,并把他们全部格式化了,这样方便我查看。
这个程序是使用curses库移动到屏幕上的某个点,再输入问题和答案,然后等待响应。但它是先到了问题的第一行,输入了一些关于白人至上的不实信息,然后等了 1/2 秒之后,又用问题覆盖了这个信息。当我发现这一点的时候,觉得这应该挺简单的,因为它可以输出内容的地方只有五个,而且这五个地方都有这种信息闪现。所以我删掉有问题的 mvprintw()以后,一切正常,或者说应该是一切正常,我以为我完成了修复。但是当我再运行它的时候,它又出现了那些不实的信息。这次虽然是不同的文字,但主题还是相同的,只是信息不同而已。
我又重新检查了我的代码,不管你信不信,这个程序又回到了它的初始状态。 15 个损坏的文件,3 个字母的变量,一切又回到了我刚开始的地方。我当时特别后悔没有把我的代码复制过来,我只能把代码再重新解开一次。我这次把它放在了三个文件中,并给它们编了不同的名字。我复制了整个目录,并将文件标记为只读。我开始修复这个程序,一切看起来都不错。现在在我的目录里有15个原始文件的副本,然后我继续运行程序,那些不当的信息又出现了。
所以说,在这个磁盘上有一个地方有继续执行此操作的源代码,并且他已经将这个程序设置为在编译时就引入该代码。所以我不得不将这个程序所包含的区域全都进行了完整的磁盘搜索,因为这是一个研究版本,所以我们拥有除了内核本身之外的所有源代码。这是一个很大的母文件,所以需要在3B2上花费一些时间,但这才第一天。
Day 2
The disk search showed up nothing. The strings were apparently either encrypted or they are buried in a library somewhere. I decide to search all libraries for the text. This is even longer than before, so day two is over.
Day 3
No results. The strings are encrypted. That means I'm going to have to follow all the header files from each #include and each one they #include to find where this is. And that will, take some time. We do alx the campus computing department that we believe someone has gained root level access to Dr. Phelps research computer, which is just a shared lab computer in the science building. They're understandably not convinced.
I start unwinding the #include files. I do that, nowhere do I find the code. So now I know it's compiled in a library.Why not just recompile all those libraries, we do have the source after all.
第 2 天:
我们在磁盘搜索中一无所获。这些字符串要么是被加密了,要么是被藏在某个角落里。所以我决定搜索所有库中的文本。这比第一天还要花费更多的时间,所以第二天就这么结束了。
第 3 天:
还是没有结果。字符串被加密了,这意味着我将不得不跟踪每个 #include 和每个 #include 中的所有母文件,来找到它的位置。这需要一些时间。我们提醒校园的计算机部门,我们认为有人获取了菲尔普斯博士研究计算机的根级访问权限,因为这个计算机只是科学楼里的一台共享计算机。但是他们并不相信我说的话,但这也是可以理解的。
我开始跟踪#include 文件。即使我这么做了,我还是找不到代码。但现在我知道了它是在库里编译的。所以我们为什么不重新编译这些库呢,毕竟我们有源代码。
The disk search showed up nothing. The strings were apparently either encrypted or they are buried in a library somewhere. I decide to search all libraries for the text. This is even longer than before, so day two is over.
Day 3
No results. The strings are encrypted. That means I'm going to have to follow all the header files from each #include and each one they #include to find where this is. And that will, take some time. We do alx the campus computing department that we believe someone has gained root level access to Dr. Phelps research computer, which is just a shared lab computer in the science building. They're understandably not convinced.
I start unwinding the #include files. I do that, nowhere do I find the code. So now I know it's compiled in a library.Why not just recompile all those libraries, we do have the source after all.
第 2 天:
我们在磁盘搜索中一无所获。这些字符串要么是被加密了,要么是被藏在某个角落里。所以我决定搜索所有库中的文本。这比第一天还要花费更多的时间,所以第二天就这么结束了。
第 3 天:
还是没有结果。字符串被加密了,这意味着我将不得不跟踪每个 #include 和每个 #include 中的所有母文件,来找到它的位置。这需要一些时间。我们提醒校园的计算机部门,我们认为有人获取了菲尔普斯博士研究计算机的根级访问权限,因为这个计算机只是科学楼里的一台共享计算机。但是他们并不相信我说的话,但这也是可以理解的。
我开始跟踪#include 文件。即使我这么做了,我还是找不到代码。但现在我知道了它是在库里编译的。所以我们为什么不重新编译这些库呢,毕竟我们有源代码。
Days 4-6
The hardest part, convincing the campus nerds they have an issue. But we finally do and Mark, the Unix admin who was hired because he married the Dean's daughter, gets busy learning how to do this. In the end, he agrees to allow me to handle it, because he just doesn't really know how to get all that stuff compiled. End of Day 6, all standard libraries are recompiled. Woo hoo!
I whip out my modified, cleaned up source and start the compile. All looks good. I run it. O M G. It did it again. 15 messed up source files and the subliminal messages are back. This is suddenly like magic. I investigate very very carefully though I am stumped. This code doesn't exist in source code. I think I might be beaten. Dr. Phelps isn't happy with the hours involved and thinks maybe we ought to just rewrite the program from scratch. "Sure", I say staring at the terminal like a lost puppy too deep in my thoughts to put out of my thinking mode, "I think you're right. That will be quicker." "Good," he says, "we can start tomorrow."
Day 7
To hell with that. This guy isn't beating me. We are compiling it from his stinking code or not at all! "You don't have to pay me anymore, Dr. Phelps, I just want lab time." This is nerd war.
Days 8-14
I get smart, I'm thinking he somehow modified the curses library.I start learning. I read manuals for 6 days, piecing together that assembly code. Waste of time, nothing seems unusual.
第 4-6 天:
但最难的部分是,要如何说服校园里宅男们相信这个库是有问题的。但我们最终还是做到了,因为马克娶了院长的女儿,所以他被聘用为Unix的管理员,他一直在学习怎么编程。所以他最后同意让我来处理这个问题了,因为他真的不知道如何编译这些东西。等到第 6 天结束的时候,所有的标准库都会被重新编译。真是太棒了!
我拿出我修改过、清理过的源代码并开始重新编译,所有的进展都很顺利。然后我又重新运行了一下程序。结果,我的天呐,又变成那样了, 15 个混乱的源文件和不实的信息就像变魔术一样又出现了。尽管我被难住了,但我还是非常仔细地继续调查。源代码中并不存在此代码。我想这次的任务我可能要失败了。菲尔普斯博士对我花了那么多时间还没解决问题很不满意,他觉得我们应该从头开始重新写程序。我此时在这个问题中陷得很深,以至于无法摆脱我的思维模式,我像一只迷路的小狗一样盯着终端机说, “当然,我认为你说的对,那样做会更快。”他说, “很好,那我们明天就可以重新开始了。”
第 7 天:
让这个程序滚蛋吧,我不会被他打败的。我们正在根据他这个恶心的代码重新编写程序,或者根本就不编了! “菲尔普斯博士,你不用再给我付钱了,我现在只想要在实验室里继续编程。”这是两个程序员之间的战争。
第 8-14 天:
我变聪明了,我觉得他是在以某种方式修改了这个程序的库。我花了6天的时间去阅读操作手册,并把这些代码拼在了一起。我在继续消耗时间,这一切看起来并没有什么不寻常的。
The hardest part, convincing the campus nerds they have an issue. But we finally do and Mark, the Unix admin who was hired because he married the Dean's daughter, gets busy learning how to do this. In the end, he agrees to allow me to handle it, because he just doesn't really know how to get all that stuff compiled. End of Day 6, all standard libraries are recompiled. Woo hoo!
I whip out my modified, cleaned up source and start the compile. All looks good. I run it. O M G. It did it again. 15 messed up source files and the subliminal messages are back. This is suddenly like magic. I investigate very very carefully though I am stumped. This code doesn't exist in source code. I think I might be beaten. Dr. Phelps isn't happy with the hours involved and thinks maybe we ought to just rewrite the program from scratch. "Sure", I say staring at the terminal like a lost puppy too deep in my thoughts to put out of my thinking mode, "I think you're right. That will be quicker." "Good," he says, "we can start tomorrow."
Day 7
To hell with that. This guy isn't beating me. We are compiling it from his stinking code or not at all! "You don't have to pay me anymore, Dr. Phelps, I just want lab time." This is nerd war.
Days 8-14
I get smart, I'm thinking he somehow modified the curses library.I start learning. I read manuals for 6 days, piecing together that assembly code. Waste of time, nothing seems unusual.
第 4-6 天:
但最难的部分是,要如何说服校园里宅男们相信这个库是有问题的。但我们最终还是做到了,因为马克娶了院长的女儿,所以他被聘用为Unix的管理员,他一直在学习怎么编程。所以他最后同意让我来处理这个问题了,因为他真的不知道如何编译这些东西。等到第 6 天结束的时候,所有的标准库都会被重新编译。真是太棒了!
我拿出我修改过、清理过的源代码并开始重新编译,所有的进展都很顺利。然后我又重新运行了一下程序。结果,我的天呐,又变成那样了, 15 个混乱的源文件和不实的信息就像变魔术一样又出现了。尽管我被难住了,但我还是非常仔细地继续调查。源代码中并不存在此代码。我想这次的任务我可能要失败了。菲尔普斯博士对我花了那么多时间还没解决问题很不满意,他觉得我们应该从头开始重新写程序。我此时在这个问题中陷得很深,以至于无法摆脱我的思维模式,我像一只迷路的小狗一样盯着终端机说, “当然,我认为你说的对,那样做会更快。”他说, “很好,那我们明天就可以重新开始了。”
第 7 天:
让这个程序滚蛋吧,我不会被他打败的。我们正在根据他这个恶心的代码重新编写程序,或者根本就不编了! “菲尔普斯博士,你不用再给我付钱了,我现在只想要在实验室里继续编程。”这是两个程序员之间的战争。
第 8-14 天:
我变聪明了,我觉得他是在以某种方式修改了这个程序的库。我花了6天的时间去阅读操作手册,并把这些代码拼在了一起。我在继续消耗时间,这一切看起来并没有什么不寻常的。
Day 15
I suddenly realize it's in the compiler. It was the compiler. And every time you compile the original code and run it puts in the subliminal message code into the source code. I'd heard of this before.
Ah ah! I've got him!!!! We have the source code for the compiler as well. I search through it looking for a reference. Lo and behold, I find it. Indeed. There is source code in the compiler/lixer that does this:
1) it examines any call to fopen(), searches the file opened looking for Dr. Phelp's questions; if it finds them then
2) it rewrites the 15 files to the current directory when compiling that specific program.
3) It then compiles Dr. Phelps program using the 15 files and outputs to the -o name in the lix phase.
第 15 天:
我这天突然意识到它可能是在编译器中。原来是编译器!每次编译并运行原始代码时,它都会将不实的信息代码放入源代码中。我以前就听说过这个。
我忽然想起我们也有编译器的源代码。我去找找看有没有参考资料,果然,我找到了。确实,在编译器或链接器中有执行此操作的源代码:
1.首先,它检查了所有对 fopen() 的调用,如果发现有这些调用的话,它就会搜索打开的文件,来查找菲尔普斯博士的问题。
2.当你开始编写该特定程序时,它就会将 15 个文件重新写到了当前的目录中。
3.然后用这15个文件编写菲尔普斯博士的程序,并在链接阶段输出不好的言论。
I suddenly realize it's in the compiler. It was the compiler. And every time you compile the original code and run it puts in the subliminal message code into the source code. I'd heard of this before.
Ah ah! I've got him!!!! We have the source code for the compiler as well. I search through it looking for a reference. Lo and behold, I find it. Indeed. There is source code in the compiler/lixer that does this:
1) it examines any call to fopen(), searches the file opened looking for Dr. Phelp's questions; if it finds them then
2) it rewrites the 15 files to the current directory when compiling that specific program.
3) It then compiles Dr. Phelps program using the 15 files and outputs to the -o name in the lix phase.
第 15 天:
我这天突然意识到它可能是在编译器中。原来是编译器!每次编译并运行原始代码时,它都会将不实的信息代码放入源代码中。我以前就听说过这个。
我忽然想起我们也有编译器的源代码。我去找找看有没有参考资料,果然,我找到了。确实,在编译器或链接器中有执行此操作的源代码:
1.首先,它检查了所有对 fopen() 的调用,如果发现有这些调用的话,它就会搜索打开的文件,来查找菲尔普斯博士的问题。
2.当你开始编写该特定程序时,它就会将 15 个文件重新写到了当前的目录中。
3.然后用这15个文件编写菲尔普斯博士的程序,并在链接阶段输出不好的言论。
The compiler was modified to put that code in Dr. Phelps program was written by the man that modified the compiler.
Several days later, an AT&T tech shows up with a disk and loads the proper compile and lixer source and we recompile the compiler from the source. That solves it. All the bad source in the compiler is gone and we've got a new clean copy of the compiler.
that source code, that now existed only in the executable compiler, put those changes back into the compiler source before it compiled it. But this time it didn't modify the /usr/src copy, it copied it to a hidden directory, modified the compiler source, compiled itself from there, and dexed the hidden directory. It took an AT&T tech to find this. The ex-grad student had poisoned the compiler to poison itself when it was recompiled. We had to put a new binary version of the compiler on disk from another 3B2 running the same revision before the problem went away.
We also found that if /sbin/login is compiled it puts in a backdoor allowing anyone who uses a specific password to login in as the root user. This computer is accessible by modem and Tymnet. Finally, this gets the computing center's attention.
编译器被修改为,将该代码放入菲尔普斯博士的程序里。这个程序是由修改编译器的人编写的。
几天后,AT&T 的技术人员带着磁盘出现在我们的面前并加载了正确的编译器和链接器的源代码,我们从源代码中重新编译了编译器。这样问题就解决了,编译器中所有的错误源代码都消失了,我们得到了一个全新的编译器副本。
那个源代码,现在只存在于可执行的编译器中,在编译之前将那些更改重新放回编译器源代码中。但这一次它并没有修改/usr/src 副本,而是将其复制到一个隐藏目录,修改了编译器源代码,从那里编译,并删除了隐藏目录。 AT&T的技术人员找到了这个问题的来源。这位前研究生在编译器重新编译时毒害了编译器。在这个问题解决之前,我们不得不把一个新的编译器的二进制版本放在另一个相同版本的3b2的磁盘上。
我们还发现,如果编译了/sbin/login,它就会设置一个后门,允许任何使用特定密码的人以 root 用户身份登录。这台计算机可以通过调制解调器和 Tymnet 访问。最后,这件事引起了计算中心的注意。
Several days later, an AT&T tech shows up with a disk and loads the proper compile and lixer source and we recompile the compiler from the source. That solves it. All the bad source in the compiler is gone and we've got a new clean copy of the compiler.
that source code, that now existed only in the executable compiler, put those changes back into the compiler source before it compiled it. But this time it didn't modify the /usr/src copy, it copied it to a hidden directory, modified the compiler source, compiled itself from there, and dexed the hidden directory. It took an AT&T tech to find this. The ex-grad student had poisoned the compiler to poison itself when it was recompiled. We had to put a new binary version of the compiler on disk from another 3B2 running the same revision before the problem went away.
We also found that if /sbin/login is compiled it puts in a backdoor allowing anyone who uses a specific password to login in as the root user. This computer is accessible by modem and Tymnet. Finally, this gets the computing center's attention.
编译器被修改为,将该代码放入菲尔普斯博士的程序里。这个程序是由修改编译器的人编写的。
几天后,AT&T 的技术人员带着磁盘出现在我们的面前并加载了正确的编译器和链接器的源代码,我们从源代码中重新编译了编译器。这样问题就解决了,编译器中所有的错误源代码都消失了,我们得到了一个全新的编译器副本。
那个源代码,现在只存在于可执行的编译器中,在编译之前将那些更改重新放回编译器源代码中。但这一次它并没有修改/usr/src 副本,而是将其复制到一个隐藏目录,修改了编译器源代码,从那里编译,并删除了隐藏目录。 AT&T的技术人员找到了这个问题的来源。这位前研究生在编译器重新编译时毒害了编译器。在这个问题解决之前,我们不得不把一个新的编译器的二进制版本放在另一个相同版本的3b2的磁盘上。
我们还发现,如果编译了/sbin/login,它就会设置一个后门,允许任何使用特定密码的人以 root 用户身份登录。这台计算机可以通过调制解调器和 Tymnet 访问。最后,这件事引起了计算中心的注意。
Anonymous
After an 11-hour work day I was greeted by my father and he announced he had promised his "future boss" that his son was going to program a "small" application for him. For free. But maybe the boss would "give a gift" to me after I complete it. His exact words.
This "small" application by any estimates would take me 1.5 months minimum, IF I didn't work 60 hours a week already. That one and a half months is an extremely conservative estimate since the guy handed him a post-it note with a 6-7 vague things as requirements.
I'm getting angry again so I'll get to the point instead of rambling on. The point is, a coder's nightmare is not made of code, bugs, programming languages, computers, tools etc. It's made of people. There's a reason coders become coders. I love computers, but man, fuck people.
当我工作了 11 个小时回到家后,我的父亲在门口迎接我,并向我宣布,他已经向他的“未来老板”承诺了,他的儿子将会为他免费编写一个“小”的应用程序。也许这个老板会在我完成这个程序之后,会送给我一份礼物。 这就是他的原话。
就算我每周工作 60个小时,这个“小”的应用程序至少也要一个半月的时间才能完成。而且这一个半月还是一个非常保守的估计,因为那个老板给他递了一张便利贴,上面写着 6-7 条模糊的要求。
我真的是要生气了,所以这次我要开门见山的跟我的父亲说,而不是跟他东拉西扯。关键是,程序员的噩梦不是由代码、错误、编程语言、计算机、工具等组成的,而是由人组成的。程序员之所以成为程序员是有原因的。我喜欢电脑,但是我真的不喜欢和人打交道。
After an 11-hour work day I was greeted by my father and he announced he had promised his "future boss" that his son was going to program a "small" application for him. For free. But maybe the boss would "give a gift" to me after I complete it. His exact words.
This "small" application by any estimates would take me 1.5 months minimum, IF I didn't work 60 hours a week already. That one and a half months is an extremely conservative estimate since the guy handed him a post-it note with a 6-7 vague things as requirements.
I'm getting angry again so I'll get to the point instead of rambling on. The point is, a coder's nightmare is not made of code, bugs, programming languages, computers, tools etc. It's made of people. There's a reason coders become coders. I love computers, but man, fuck people.
当我工作了 11 个小时回到家后,我的父亲在门口迎接我,并向我宣布,他已经向他的“未来老板”承诺了,他的儿子将会为他免费编写一个“小”的应用程序。也许这个老板会在我完成这个程序之后,会送给我一份礼物。 这就是他的原话。
就算我每周工作 60个小时,这个“小”的应用程序至少也要一个半月的时间才能完成。而且这一个半月还是一个非常保守的估计,因为那个老板给他递了一张便利贴,上面写着 6-7 条模糊的要求。
我真的是要生气了,所以这次我要开门见山的跟我的父亲说,而不是跟他东拉西扯。关键是,程序员的噩梦不是由代码、错误、编程语言、计算机、工具等组成的,而是由人组成的。程序员之所以成为程序员是有原因的。我喜欢电脑,但是我真的不喜欢和人打交道。
Aladin Bensassi
Code works perfectly after the first try. I mean, what kind of sorcery is this? The stars are not even aligned today.
A call from a relative. I could be in a hospital and they’d still ask if I can fix the “Internet” for them.
Favorite coffee shop is closed. What am I supposed to drink? Water?
Clients from hell.
“Hey bro, I have this awesome idea that can change the world, you can code it for me, and I’ll even give you 30% of the company. No, really hear me out, it’s like Facebook, but instead of sending full text messages, only 140 characters. Isn’t this revolutionary?”
Clients who ask for changes that could take me days to implement, but want them at the end of the day.
“This is the computer genius I told you about. He can totally fix your printer that fell from the fourth floor.”
代码在我第一次尝试后就完美的运行了。 我的意思是,这是哪门子的魔法啊? 今天的星星甚至都没有对齐呢。
一个亲戚给我打电话,问我能不能帮他们修好“网络”。 就算我在医院,他们还是会问我能不能帮他们修。
我最喜欢的咖啡店关门了。所以我应该喝什么呢?喝水吗?
我还有来自地狱的客户。
“嘿,兄弟,我有一个可以改变世界的很棒的想法,你可以帮我写代码,我甚至可以给你公司30%的股份。 不,你听我说完,它就像 Facebook一样,但不是发送短信,它只有 140 个字符。 这难道不是革命性的变化吗?”
客户提的要求我可能要花好几天的时间才能完成,但是他们想要我一天就能完成。
“这就是我跟你说过的那个计算机天才。 他甚至可以把你从四楼掉下去的打印机都能修好。”
原创翻译:龙腾网 https://www.ltaaa.cn 转载请注明出处
Code works perfectly after the first try. I mean, what kind of sorcery is this? The stars are not even aligned today.
A call from a relative. I could be in a hospital and they’d still ask if I can fix the “Internet” for them.
Favorite coffee shop is closed. What am I supposed to drink? Water?
Clients from hell.
“Hey bro, I have this awesome idea that can change the world, you can code it for me, and I’ll even give you 30% of the company. No, really hear me out, it’s like Facebook, but instead of sending full text messages, only 140 characters. Isn’t this revolutionary?”
Clients who ask for changes that could take me days to implement, but want them at the end of the day.
“This is the computer genius I told you about. He can totally fix your printer that fell from the fourth floor.”
代码在我第一次尝试后就完美的运行了。 我的意思是,这是哪门子的魔法啊? 今天的星星甚至都没有对齐呢。
一个亲戚给我打电话,问我能不能帮他们修好“网络”。 就算我在医院,他们还是会问我能不能帮他们修。
我最喜欢的咖啡店关门了。所以我应该喝什么呢?喝水吗?
我还有来自地狱的客户。
“嘿,兄弟,我有一个可以改变世界的很棒的想法,你可以帮我写代码,我甚至可以给你公司30%的股份。 不,你听我说完,它就像 Facebook一样,但不是发送短信,它只有 140 个字符。 这难道不是革命性的变化吗?”
客户提的要求我可能要花好几天的时间才能完成,但是他们想要我一天就能完成。
“这就是我跟你说过的那个计算机天才。 他甚至可以把你从四楼掉下去的打印机都能修好。”
原创翻译:龙腾网 https://www.ltaaa.cn 转载请注明出处
Andy Kleinman
I crashed the New York Times once.
Seriously.
See, I worked for a company that sold cars online, and we had the contract to do that on the New York Times' website, and one day we get a very angry call from them because their website is crashing and they've traced it to something on our side. We had a devil of a time tracking the cause of the crashes down, because it seemed to be happening at random. The web servers would crash, we'd restart them, they'd go all right for a bit, then slow down, and then crash again. It didn't happen after a set time period. It didn't happen when you did something specific. But it happened. Inevitably, it always happened.
After staying several hours late (you do not go home when you've got a live crash bug), I suddenly realized what was happening, and with a sinking sensation realized it was my fault. On one minor side page I'd made one minor assumption, and every experienced coder is going to slap their foreheads in frustration when they read it: I'd assumed the data would always be there.
It wasn't. The database had crashed. (So it was their fault too.) And my code was programmed to go and get the data and then not do anything else until it got the data. And there was no data to get. So the code was just sitting there, unable to complete, constantly asking the server for data that wasn't there. And since it wasn't there, it just sat there, asking over and over and over again with the monomaniacal tenacity .And since this particular piece of code ran when the associated widget loaded up on the sidebar of different pages on the newspaper's website, every time someone loaded a page, another instance of the code appeared on the server and started asking for its data. They'd just build up and build up and build up, not going away, until the server was first full of nothing except instances of the code bugging it for data, and then overfull and crashing as a result.
I rewrote the code so that it would check to see if there was data before it started to process the data, pushed that live in a hurry, we restarted the servers one more time, and the problem was fixed. And I have never trusted data since
我曾经搞砸过《纽约时报》。
是非常严重地搞砸。
我在一家线上销售汽车的公司工作,我们在《纽约时报》的网站上签了合同,有一天我们接到他们的电话,他们很生气,因为他们的网站崩溃了,他们追踪到是我们这边的某个东西导致的。因为这件事是随机发生的,所以我们花了好长的时间才找到网站崩溃的原因。网络服务器崩溃了,我们就会重新启动它们,它们正常运行了一段时间,然后又变慢了,最后再次崩溃。它并不是在固定的时间段内发生的。它不是因为你做了什么特别的事才发生的。但它还是发生了,这是不可避免地,只要你使用网络,就总是会发生这样的事。
在回家晚了几个小时之后(当你遇到一个崩溃的bug时,你就不能回家),我突然意识到发生了什么,并意识到这可能是我的错,当我一想到这一点,我就感到非常沮丧。我在一个小页面上,做了一个小小的程序,每个有经验的程序员在读到这篇文章时,都会敲敲自己的头:我以为数据会一直存在那里,但其实不是。所以数据库崩溃了。(所以这也是他们的错。)我写的代码是被设定去获取数据的,所以它在获取数据之前什么都不会做。因为没有数据可以获取,所以代码只能停在那里,什么都做不了,只能不断地向服务器请求不存在的数据。因为它不存在,所以它只是坐在那里,一遍又一遍地问,带着一种偏执的固执。由于这段代码是在《纽约时报》网站的侧边栏添加的,所以它只有在加载相关的小程序时才会运行,因此每当有一个人加载页面时,服务器上就会出现另一个代码并开始请求它的数据。他们只会不断地积累,不断地积累,但不会消失,直到服务器上除了这个错误的代码什么都没有,最后服务器就会因为超载而导致崩溃。
我重新写了代码,让它在开始处理数据之前先检查下是否有数据,然后我就赶快将这个代码发送了出去,我们再次重新启动了服务器,问题得到了解决。从那以后我就再也不相信数据了。
I crashed the New York Times once.
Seriously.
See, I worked for a company that sold cars online, and we had the contract to do that on the New York Times' website, and one day we get a very angry call from them because their website is crashing and they've traced it to something on our side. We had a devil of a time tracking the cause of the crashes down, because it seemed to be happening at random. The web servers would crash, we'd restart them, they'd go all right for a bit, then slow down, and then crash again. It didn't happen after a set time period. It didn't happen when you did something specific. But it happened. Inevitably, it always happened.
After staying several hours late (you do not go home when you've got a live crash bug), I suddenly realized what was happening, and with a sinking sensation realized it was my fault. On one minor side page I'd made one minor assumption, and every experienced coder is going to slap their foreheads in frustration when they read it: I'd assumed the data would always be there.
It wasn't. The database had crashed. (So it was their fault too.) And my code was programmed to go and get the data and then not do anything else until it got the data. And there was no data to get. So the code was just sitting there, unable to complete, constantly asking the server for data that wasn't there. And since it wasn't there, it just sat there, asking over and over and over again with the monomaniacal tenacity .And since this particular piece of code ran when the associated widget loaded up on the sidebar of different pages on the newspaper's website, every time someone loaded a page, another instance of the code appeared on the server and started asking for its data. They'd just build up and build up and build up, not going away, until the server was first full of nothing except instances of the code bugging it for data, and then overfull and crashing as a result.
I rewrote the code so that it would check to see if there was data before it started to process the data, pushed that live in a hurry, we restarted the servers one more time, and the problem was fixed. And I have never trusted data since
我曾经搞砸过《纽约时报》。
是非常严重地搞砸。
我在一家线上销售汽车的公司工作,我们在《纽约时报》的网站上签了合同,有一天我们接到他们的电话,他们很生气,因为他们的网站崩溃了,他们追踪到是我们这边的某个东西导致的。因为这件事是随机发生的,所以我们花了好长的时间才找到网站崩溃的原因。网络服务器崩溃了,我们就会重新启动它们,它们正常运行了一段时间,然后又变慢了,最后再次崩溃。它并不是在固定的时间段内发生的。它不是因为你做了什么特别的事才发生的。但它还是发生了,这是不可避免地,只要你使用网络,就总是会发生这样的事。
在回家晚了几个小时之后(当你遇到一个崩溃的bug时,你就不能回家),我突然意识到发生了什么,并意识到这可能是我的错,当我一想到这一点,我就感到非常沮丧。我在一个小页面上,做了一个小小的程序,每个有经验的程序员在读到这篇文章时,都会敲敲自己的头:我以为数据会一直存在那里,但其实不是。所以数据库崩溃了。(所以这也是他们的错。)我写的代码是被设定去获取数据的,所以它在获取数据之前什么都不会做。因为没有数据可以获取,所以代码只能停在那里,什么都做不了,只能不断地向服务器请求不存在的数据。因为它不存在,所以它只是坐在那里,一遍又一遍地问,带着一种偏执的固执。由于这段代码是在《纽约时报》网站的侧边栏添加的,所以它只有在加载相关的小程序时才会运行,因此每当有一个人加载页面时,服务器上就会出现另一个代码并开始请求它的数据。他们只会不断地积累,不断地积累,但不会消失,直到服务器上除了这个错误的代码什么都没有,最后服务器就会因为超载而导致崩溃。
我重新写了代码,让它在开始处理数据之前先检查下是否有数据,然后我就赶快将这个代码发送了出去,我们再次重新启动了服务器,问题得到了解决。从那以后我就再也不相信数据了。
Anonymous
Internal Politics
I have read quite a few answers here, but none of them touched this point. Consider this situation : you come up with an idea for small side project and you start working on it in your spare time. Now people start taking notice of this initiative and soon your manager assigns one more person to work on this with you.
When the project is completed, the idea is presented to the leadership. But wait, you didn't even know about this meeting. The meeting was set up by your manager and only those who are close to him are the ones who were invited to present the idea. You confront the others about why you were not included and your manager takes their side saying to think of the bigger picture and all the other bull shit that they say.
This happened with me exactly a week ago. This made me realize that this is not the place I want to work in. Hence started applying to various companies. Three days in, 2 job offers in my hand. Today before I sat down to write this answer, I handed in my resignation letter to my manager. One of the best decisions so far in my career.
还有公司里的内部斗争。
我在这里看到了很多答案,但没有一个答案涉及到这一点。试想一下这种情况:你提出了一个小项目的想法,然后你就用你的业余时间来做它。有人注意到你的这个举动,很快你的经理就指派了一个人来和你一起做这件事。
当这个项目完成之后,你的这个想法就在会议上被提交给了上级领导。但是等等,你根本就不知道有这次会议。会议是由你的经理安排的,只有那些与他关系密切的人才会被邀请来这个会议陈述这个想法。你质问其他人为什么不把你加入这个项目里,你的经理站在他们一边,说要考虑大局,以及他们所说的一些废话。
这件事就发生在一周前。这让我意识到这不是我想要工作的地方。所以我就开始给不同的公司投简历。三天过去了,我现在手上有两份工作邀请。今天,在我坐下来写这个答案之前,我已经把我的辞职信交给了我的经理。这是我迄今为止的职业生涯中做的最好的决定之一。
Internal Politics
I have read quite a few answers here, but none of them touched this point. Consider this situation : you come up with an idea for small side project and you start working on it in your spare time. Now people start taking notice of this initiative and soon your manager assigns one more person to work on this with you.
When the project is completed, the idea is presented to the leadership. But wait, you didn't even know about this meeting. The meeting was set up by your manager and only those who are close to him are the ones who were invited to present the idea. You confront the others about why you were not included and your manager takes their side saying to think of the bigger picture and all the other bull shit that they say.
This happened with me exactly a week ago. This made me realize that this is not the place I want to work in. Hence started applying to various companies. Three days in, 2 job offers in my hand. Today before I sat down to write this answer, I handed in my resignation letter to my manager. One of the best decisions so far in my career.
还有公司里的内部斗争。
我在这里看到了很多答案,但没有一个答案涉及到这一点。试想一下这种情况:你提出了一个小项目的想法,然后你就用你的业余时间来做它。有人注意到你的这个举动,很快你的经理就指派了一个人来和你一起做这件事。
当这个项目完成之后,你的这个想法就在会议上被提交给了上级领导。但是等等,你根本就不知道有这次会议。会议是由你的经理安排的,只有那些与他关系密切的人才会被邀请来这个会议陈述这个想法。你质问其他人为什么不把你加入这个项目里,你的经理站在他们一边,说要考虑大局,以及他们所说的一些废话。
这件事就发生在一周前。这让我意识到这不是我想要工作的地方。所以我就开始给不同的公司投简历。三天过去了,我现在手上有两份工作邀请。今天,在我坐下来写这个答案之前,我已经把我的辞职信交给了我的经理。这是我迄今为止的职业生涯中做的最好的决定之一。
Calvin Noronha, Technical Manager/Architect at IBM focussing on Salesforce
Being in a project surrounded by non technical functional consultants or managers who think you are a wizard/genie/magician who can conjure up any code, learn any new programming language in 2 mins, build A+ level responsive UI even if you are a back end developer, do the work of 20 developers in a day and simply get all their fancy ideas to reality. In other words, stuck in a team which is bereft of the basic understanding of development and having highly unrealistic.
在一个没有技术顾问或经理的项目中,他们认为你是一个可以召唤出任何代码的巫师、精灵、或魔术师,他们认为你可以在 2 分钟之内学会一门新的编程语言,即使你是后端的开发人员,你也能构建 A+ 级别的响应式 UI ,你能在一天内完成 20 个开发人员的工作,并将他们所有的幻想变成现实。换句话说,他们被困在一个对开发缺乏基本理解的思维中,并且对他们唯一的开发人员有着非常不切实际的期望。
Being in a project surrounded by non technical functional consultants or managers who think you are a wizard/genie/magician who can conjure up any code, learn any new programming language in 2 mins, build A+ level responsive UI even if you are a back end developer, do the work of 20 developers in a day and simply get all their fancy ideas to reality. In other words, stuck in a team which is bereft of the basic understanding of development and having highly unrealistic.
在一个没有技术顾问或经理的项目中,他们认为你是一个可以召唤出任何代码的巫师、精灵、或魔术师,他们认为你可以在 2 分钟之内学会一门新的编程语言,即使你是后端的开发人员,你也能构建 A+ 级别的响应式 UI ,你能在一天内完成 20 个开发人员的工作,并将他们所有的幻想变成现实。换句话说,他们被困在一个对开发缺乏基本理解的思维中,并且对他们唯一的开发人员有着非常不切实际的期望。
Masoud Gheysari, started programming when I was 10 with my Commodore 64
This is not my nightmare, but something that happened to me in real life. When you read this, it will become YOUR nightmare from now on!
The situation:
I'm a senior software developer working at a large software company,
We write in PHP and use Zend IDE 4.0,
The Ctrl key on my keyboard is kind of broken, sometimes it doesn't respond when pressed,
I'm working on a large enterprise web application for a government project with an approaching deadline.
I got to work in the morning, turned on my computer and started working on a PHP file. I wrote thousands of lines of code, solved many unsolvable problems, and fixed many hard bugs. I had a super productive day. At the end of the day, I asked my boss and my project manager to see the result of my work. I, overflowed by Serotonin resulted from a good work day, presented everything on my computer while they were standing behind me and they got happy.
这不是我的噩梦,而是在现实生活中发生在我身上的事情。当你读到这篇文章的时候,它将会成为您的噩梦!
这件事的情况是:
我是一家大型软件公司的高级软件开发人员,
我们是用 PHP 编写程序并使用 Zend IDE 4.0,
我键盘上的 Ctrl 键坏了,有时按下它没有反应,
我正在为一个政府项目开发一个大型的企业网络应用程序,时间紧迫。
我从早上就开始工作了,我打开我的电脑并开始处理一个 PHP 文件。我编写了数千行代码,解决了许多无法解决的问题,并修复了许多棘手的bug。我度过了非常充实高效的一天。在一天结束的时候,我让我的老板和我的项目经理看到了我的工作成果。当他们站在我的身后时,看到我电脑上所展示的东西,他们很高兴。
原创翻译:龙腾网 https://www.ltaaa.cn 转载请注明出处
This is not my nightmare, but something that happened to me in real life. When you read this, it will become YOUR nightmare from now on!
The situation:
I'm a senior software developer working at a large software company,
We write in PHP and use Zend IDE 4.0,
The Ctrl key on my keyboard is kind of broken, sometimes it doesn't respond when pressed,
I'm working on a large enterprise web application for a government project with an approaching deadline.
I got to work in the morning, turned on my computer and started working on a PHP file. I wrote thousands of lines of code, solved many unsolvable problems, and fixed many hard bugs. I had a super productive day. At the end of the day, I asked my boss and my project manager to see the result of my work. I, overflowed by Serotonin resulted from a good work day, presented everything on my computer while they were standing behind me and they got happy.
这不是我的噩梦,而是在现实生活中发生在我身上的事情。当你读到这篇文章的时候,它将会成为您的噩梦!
这件事的情况是:
我是一家大型软件公司的高级软件开发人员,
我们是用 PHP 编写程序并使用 Zend IDE 4.0,
我键盘上的 Ctrl 键坏了,有时按下它没有反应,
我正在为一个政府项目开发一个大型的企业网络应用程序,时间紧迫。
我从早上就开始工作了,我打开我的电脑并开始处理一个 PHP 文件。我编写了数千行代码,解决了许多无法解决的问题,并修复了许多棘手的bug。我度过了非常充实高效的一天。在一天结束的时候,我让我的老板和我的项目经理看到了我的工作成果。当他们站在我的身后时,看到我电脑上所展示的东西,他们很高兴。
原创翻译:龙腾网 https://www.ltaaa.cn 转载请注明出处
After they gave me the "nice job" look, I decided to save the file for the last time, commit the changes to our Visual SourceSafe server, and leave work. These all happened in 3 seconds:
I tried to press Ctrl+S to save the file. But I mistakenly pressed Ctrl+A (sext all) instead. The whole text of my file got sexted.
Once again I tried to press Ctrl+S. But since my Ctrl was semi-broken, this time I didn't press it hard enough and it didn't work. So, my whole thousands of lines of code got erased and got replaced by a single "s".
I panicked. I pressed Ctrl+S once again, and this time it worked, and saved the new file contents (a single byte "s").
These all happened in 3 seconds. I tried to use Ctrl+Z to undo the last change. But as you may know, in early versions of Zend IDE, the undo function was implemented very badly. So it got me to the morning, when I started my work on the file.
There was no backup or SCM revision. I lost everything. I just wanted to cry, and cry, and cry... The good thing was that my boss and the project manager saw the completed work and witnessed the procedure of destroying my own work. I stood there for a few minutes shocked, and then I left work sad and depressed.
Needless to say, I got a new keyboard the next day! But I learned my lesson for life. Nowadays I always backup my work. I install Ditto (a very good open source clipboard manager program for Windows) and periodically "Ctrl+A, Ctrl+C" (copy all) my work into the clipboard just in case. I always use source control software (Git) and commit regularly.
他们给了我一个”干得漂亮”的表情后,我决定最后再保存一次文件,我将提交到我们的 Visual SourceSafe 服务器上,然后就关闭了工作。这些事都发生在 3 秒之内:
我尝试按 Ctrl+S 保存文件。但我错误地按下了 Ctrl+A(全选)。我文件的整个文本都被选中了。
我再次尝试按 Ctrl+S。但是由于我的 Ctrl 是半坏的,而这一次我又没有用力按下它,所以它没起任何作用。所以,我的数千行代码都被删除了,并被一个“s”取代了。
我惊慌失措。我再次按下 Ctrl+S,这次它起作用了,并保存了新的文件内容(一个字节“s”)。
这一切都发生在 3 秒之内。我尝试使用 Ctrl+Z 撤消上次更改。但是您可能知道,在 Zend IDE 的早期版本中,撤消功能非常糟糕。所以它让我到了第二天早上,还在处理那份文件。
由于我没有备份或留存 SCM 的修订版。所以我失去了一切。我只想哭,不停的哭,但好在我的老板和项目经理看到我完成了工作,并见证了我销毁我自己工作成果的过程。我当时震惊地呆在原地几分钟,然后又沮丧地离开了我的工作岗位。
不用说,我第二天就得到了一个新的键盘!但我这次吸取了人生的教训。现在我经常备份我的工作。我安装了一个 Ditto(一个非常好的 Windows 开源剪贴板管理器程序)并定期“Ctrl+A、Ctrl+C”(复制所有的东西)我的工作到剪贴板里,以防万一。我一直在使用源代码管理软件 (Git) 并定期提交。
原创翻译:龙腾网 https://www.ltaaa.cn 转载请注明出处
I tried to press Ctrl+S to save the file. But I mistakenly pressed Ctrl+A (sext all) instead. The whole text of my file got sexted.
Once again I tried to press Ctrl+S. But since my Ctrl was semi-broken, this time I didn't press it hard enough and it didn't work. So, my whole thousands of lines of code got erased and got replaced by a single "s".
I panicked. I pressed Ctrl+S once again, and this time it worked, and saved the new file contents (a single byte "s").
These all happened in 3 seconds. I tried to use Ctrl+Z to undo the last change. But as you may know, in early versions of Zend IDE, the undo function was implemented very badly. So it got me to the morning, when I started my work on the file.
There was no backup or SCM revision. I lost everything. I just wanted to cry, and cry, and cry... The good thing was that my boss and the project manager saw the completed work and witnessed the procedure of destroying my own work. I stood there for a few minutes shocked, and then I left work sad and depressed.
Needless to say, I got a new keyboard the next day! But I learned my lesson for life. Nowadays I always backup my work. I install Ditto (a very good open source clipboard manager program for Windows) and periodically "Ctrl+A, Ctrl+C" (copy all) my work into the clipboard just in case. I always use source control software (Git) and commit regularly.
他们给了我一个”干得漂亮”的表情后,我决定最后再保存一次文件,我将提交到我们的 Visual SourceSafe 服务器上,然后就关闭了工作。这些事都发生在 3 秒之内:
我尝试按 Ctrl+S 保存文件。但我错误地按下了 Ctrl+A(全选)。我文件的整个文本都被选中了。
我再次尝试按 Ctrl+S。但是由于我的 Ctrl 是半坏的,而这一次我又没有用力按下它,所以它没起任何作用。所以,我的数千行代码都被删除了,并被一个“s”取代了。
我惊慌失措。我再次按下 Ctrl+S,这次它起作用了,并保存了新的文件内容(一个字节“s”)。
这一切都发生在 3 秒之内。我尝试使用 Ctrl+Z 撤消上次更改。但是您可能知道,在 Zend IDE 的早期版本中,撤消功能非常糟糕。所以它让我到了第二天早上,还在处理那份文件。
由于我没有备份或留存 SCM 的修订版。所以我失去了一切。我只想哭,不停的哭,但好在我的老板和项目经理看到我完成了工作,并见证了我销毁我自己工作成果的过程。我当时震惊地呆在原地几分钟,然后又沮丧地离开了我的工作岗位。
不用说,我第二天就得到了一个新的键盘!但我这次吸取了人生的教训。现在我经常备份我的工作。我安装了一个 Ditto(一个非常好的 Windows 开源剪贴板管理器程序)并定期“Ctrl+A、Ctrl+C”(复制所有的东西)我的工作到剪贴板里,以防万一。我一直在使用源代码管理软件 (Git) 并定期提交。
原创翻译:龙腾网 https://www.ltaaa.cn 转载请注明出处
Edit: some readers have suggested some ideas to prevent this problem, such as using Git, use a better IDE, replacing my keyboard, etc. And they called me ignorant and unprofessional. So this is my answer:
It was an unfortunate accident. It could happened even to Bill Gates, Steve Jobs, Linus Torvalds, Mark Zackerburg, etc. Even with the best keyboards, IDEs, source control software, etc. I mean if it's going to happen, then it's going to happen.
This story belongs to 8-10 years ago. So no Git or Dropbox or advanced IDEs with features like auto backup, revisions, commits, etc. We even haven't had a stable internet connection inside the company. My monitor as a senior software developer was a 17" CRT monitor for God's sake!
Zend IDE was the official IDE for the company. Visual SourceSafe was the official source control and Windows was the official OS. While personally I prefer using Eclipse (and Git and FreeBSD/Linux), I had no other choice than following the rules. Fortunately Zend IDE 5.0 was based on Eclipse.
Replacing the keyboard is hard for me. I think more professional programmers understand me. Even a slight change in the keys placement, size, smoothness, ... can highly reduce your typing performance and increase your use of backspace. So when my keyboard gets broken, I need to spend a lot of time to look for a good replacement.
It's true that keyboards has two Ctrl keys and I could also use the Edit menu. But when you get used some patterns, you would use them without thinking. Also to press Ctrl+S, you use the nearest and easiest Ctrl key to S, in this case the left Ctrl. I don't think anybody use the right Ctrl or the Edit menu ever!
The file I was working on that day was part of a huge proprietary PHP frxwork. The frxwork structure dictated how the files should be arranged. From time to time, we had no other way than putting thousands of lines of code in a single file.
I'm a programmer for 20 years. I don't say that I'm too professional. But I probably have enough experience to know what I'm doing and is this a correct way to do something or not. This was an "accident".
编辑:有一些读者提出了一些建议来防止再次出现这个问题,例如使用Git,选择使用更好的IDE,更换我的键盘等等。他们还说我既无知又不专业。所以这是我的回答:
这是一次不幸的事故。它甚至可能会发生在比尔·盖茨、史蒂夫·乔布斯、莱纳斯·托瓦兹、马克·扎克伯格他们身上。即使是有最好的键盘、IDE、源代码控制软件等,都有可能会出现这种意外。我的意思是,命中注定要发生的事,就一定会发生。
这个故事发生在8-10年前。所以没有 Git 或 Dropbox 或具有自动备份、修订、提交等功能的高级 IDE。我们公司内部甚至还没有稳定的网络连接。作为一个高级软件的开发者,我的显示器竟然还是17英寸的CRT显示器!
Zend IDE 是该公司的官方 IDE。 Visual SourceSafe 是官方的源代码控制,Windows 是官方的操作系统。虽然我个人更喜欢使用 Eclipse(以及 Git 和 FreeBSD/Linux),但除了遵守规则之外,我别无选择。幸运的是 Zend IDE 5.0 是基于 Eclipse的。
换键盘对我来说很难。我想只有专业的程序员能理解我。即使在按键的位置、大小、平滑度等方面有一点点的变化,都会大大降低您的打字速度,并提高了退格键的使用频率。所以当我的键盘坏了,我需要花很多的时间去寻找一个好的替代品。
确实,键盘有两个 Ctrl 键,我也可以使用“Edit”菜单。但是当您使用某些键,使用习惯了以后,您就会不假思索地使用它们。同样要按 Ctrl+S,您可以使用与 S 最接近且最简单的 Ctrl 键,在本例中为左侧 Ctrl按键。我认为从来没有人使用过正确的 Ctrl 或Edit菜单!
我那天正在工作的文件是一个巨大的PHP 框架的一部分。框架结构决定了文件的排列方式。有时,我们只能将数千行代码放在一个文件中。
我做了20年的程序员。我并不是说我自己非常专业,而是我有足够的经验,知道我在做什么,以及这么做对不对。所以这件事的发生就是一个“意外”。
It was an unfortunate accident. It could happened even to Bill Gates, Steve Jobs, Linus Torvalds, Mark Zackerburg, etc. Even with the best keyboards, IDEs, source control software, etc. I mean if it's going to happen, then it's going to happen.
This story belongs to 8-10 years ago. So no Git or Dropbox or advanced IDEs with features like auto backup, revisions, commits, etc. We even haven't had a stable internet connection inside the company. My monitor as a senior software developer was a 17" CRT monitor for God's sake!
Zend IDE was the official IDE for the company. Visual SourceSafe was the official source control and Windows was the official OS. While personally I prefer using Eclipse (and Git and FreeBSD/Linux), I had no other choice than following the rules. Fortunately Zend IDE 5.0 was based on Eclipse.
Replacing the keyboard is hard for me. I think more professional programmers understand me. Even a slight change in the keys placement, size, smoothness, ... can highly reduce your typing performance and increase your use of backspace. So when my keyboard gets broken, I need to spend a lot of time to look for a good replacement.
It's true that keyboards has two Ctrl keys and I could also use the Edit menu. But when you get used some patterns, you would use them without thinking. Also to press Ctrl+S, you use the nearest and easiest Ctrl key to S, in this case the left Ctrl. I don't think anybody use the right Ctrl or the Edit menu ever!
The file I was working on that day was part of a huge proprietary PHP frxwork. The frxwork structure dictated how the files should be arranged. From time to time, we had no other way than putting thousands of lines of code in a single file.
I'm a programmer for 20 years. I don't say that I'm too professional. But I probably have enough experience to know what I'm doing and is this a correct way to do something or not. This was an "accident".
编辑:有一些读者提出了一些建议来防止再次出现这个问题,例如使用Git,选择使用更好的IDE,更换我的键盘等等。他们还说我既无知又不专业。所以这是我的回答:
这是一次不幸的事故。它甚至可能会发生在比尔·盖茨、史蒂夫·乔布斯、莱纳斯·托瓦兹、马克·扎克伯格他们身上。即使是有最好的键盘、IDE、源代码控制软件等,都有可能会出现这种意外。我的意思是,命中注定要发生的事,就一定会发生。
这个故事发生在8-10年前。所以没有 Git 或 Dropbox 或具有自动备份、修订、提交等功能的高级 IDE。我们公司内部甚至还没有稳定的网络连接。作为一个高级软件的开发者,我的显示器竟然还是17英寸的CRT显示器!
Zend IDE 是该公司的官方 IDE。 Visual SourceSafe 是官方的源代码控制,Windows 是官方的操作系统。虽然我个人更喜欢使用 Eclipse(以及 Git 和 FreeBSD/Linux),但除了遵守规则之外,我别无选择。幸运的是 Zend IDE 5.0 是基于 Eclipse的。
换键盘对我来说很难。我想只有专业的程序员能理解我。即使在按键的位置、大小、平滑度等方面有一点点的变化,都会大大降低您的打字速度,并提高了退格键的使用频率。所以当我的键盘坏了,我需要花很多的时间去寻找一个好的替代品。
确实,键盘有两个 Ctrl 键,我也可以使用“Edit”菜单。但是当您使用某些键,使用习惯了以后,您就会不假思索地使用它们。同样要按 Ctrl+S,您可以使用与 S 最接近且最简单的 Ctrl 键,在本例中为左侧 Ctrl按键。我认为从来没有人使用过正确的 Ctrl 或Edit菜单!
我那天正在工作的文件是一个巨大的PHP 框架的一部分。框架结构决定了文件的排列方式。有时,我们只能将数千行代码放在一个文件中。
我做了20年的程序员。我并不是说我自己非常专业,而是我有足够的经验,知道我在做什么,以及这么做对不对。所以这件事的发生就是一个“意外”。
很赞 0
收藏