Translations:Prologue/24/zh-cn
Appearance
Like the famous line “I would have written a shorter letter, but I did not have the time,” it’s easier to write a program in sloppy code that goes on for pages than to write the same program on a single page. The sloppy version may also run more slowly and use more memory. Over the course of that hike, I had the time to write short. On that long day I slimmed it down more, like whittling little pieces off a stick to sharpen the point. What I made seemed efficient and pleasingly simple. It was by far the best code I had ever written.
就像那句著名的台词:“我本可以写一封更短的信,但我没有时间。”编写一个冗长、凌乱的程序比编写一个简洁的程序要容易得多。这种凌乱的版本运行起来可能更慢,占用的内存也更多。在那次徒步旅行中,我有时间写出简洁的代码。在那个漫长的一天里,我进一步精简了它,就像削木棍时一点点削去小块,以磨尖顶端。我写出的代码似乎既高效又简洁悦目。这无疑是迄今为止我写过的最好的代码。