编程为什么有趣?浅谈编程的快乐。
首先,这种快乐是一种创建事物的纯粹快乐。如同小孩在玩泥巴时感到快乐一样,成年人喜欢创建事物,特别是自己进行设计。我想这种快乐是上帝创造世界的折射,一种呈现在每片独特的、崭新的树叶和雪花上的喜悦。
其次,这种快乐来自于开发对他人有用的东西。内心深处,我们期望我们的劳动成果能够被他人使用,并能对他们有所帮助。从这一角度而言,这同小孩用粘土为“爸爸的办公室”捏制铅笔盒没有任何本质的区别。
第三,快乐来自于整个过程体现出的一股强大的魅力--将相互啮合的零部件组装在一起,看到它们以精妙的方式运行着,并收到了预期的效果。比起弹球游戏机或自动电唱机所具有的迷人魅力,程序化的计算机毫不逊色。第四,这种快乐是持续学习的快乐,它来自于这项工作的非重复特性。人们所面临的问题总有这样那样的不同,因而解决问题的人可以从中学习新的事物,有时是实践上的,有时是理论上的,或者兼而有之。
最后,这种快乐还来自于在易于驾驭的介质上工作。程序员,就像诗人一样,几乎仅仅在单纯的思考中工作。程序员凭空地运用自己的想象,来建造自己的“城堡”。很少有创造介质如此灵活,如此易于精炼和重建,如此容易实现概念上的设想(不过我们将会看到,容易驾驭的特性也有它自己的问题)。
然而程序毕竟同诗歌不同,它是实实在在的东西;它可以移动和运行,能独立产生可见的输出;它能打印结果,绘制图形,发出声音,移动支架。神话和传说中的魔术在我们的时代已变成现实。在键盘上键入正确的咒语,屏幕会活动、变幻,显示出前所未有的也不可能存在的事物。
Why is programming interesting? Talking about the happiness of programming.
First of all, this kind of happiness is a kind of pure happiness to create things. Just as children feel happy when playing mud, adults like to create things, especially to design by themselves. I think this kind of happiness is the reflection of God's creation of the world, a kind of joy presented on every unique and brand-new leaf and snowflake.
Secondly, this happiness comes from developing something useful to others. Deep down, we expect our Labor achievements to be used by others and helpful to them. From this point of view, there is no essential difference between this and the children using clay to pinch the pencil box for "dad's office.
Third, happiness comes from a strong charm reflected in the whole process-assemble the parts that mesh with each other, see them running in a delicate way, and receive expectations
The effect. Compared with the charming charm of pinball game machines or automatic record machines, programmed computers are no less attractive.
Fourth, this kind of happiness is the happiness of continuous learning, which comes from the non-repetitive characteristics of this work. The problems people face are always different, so people who solve problems can learn new things from them, sometimes in practice, sometimes in theory, or both. Finally, this happiness also comes from working on easy-to-control media. Programmers, like poets, work almost only in simple thinking. Programmers use their imagination to build their own "castles". Few creative media are so flexible, so easy to refine and rebuild, and so easy to realize conceptual assumptions (but we will see that the easy-to-control feature also has its own problems).
However, the program is different from poetry after all. It is a real thing; It can move and run, and can produce visible output independently; It can print results, draw graphics, make sounds and move brackets. Magic in myths and legends has become a reality in our times. Type the correct spell on the keyboard, and the screen will move and change, showing unprecedented and impossible things.
《人月神话》读书笔记