鱼C论坛

 找回密码
 立即注册
查看: 47|回复: 2

[脑高潮] 0099 - The Little Printf|【双语翻译|什么是真正的程序员】

[复制链接]
最佳答案
553 
发表于 5 天前 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
本帖最后由 不二如是 于 2020-10-19 09:53 编辑

printf.png


原文:https://ferd.ca/the-little-printf.html

作者仿照《小王子》中的情节,通过小 printf 遇见的不同类型的程序员,感悟出什么是真正的程序员。

文章很不错,翻译和鱼油们分享下。




Chapter 1
第一章


I've been lucky enough to have been born before computers and video games were ubiquitous. I had the luck to play outdoors with friends and my brother, and of inventing our own games.
我非常幸运出生在一个电脑和电子游戏还没有普遍的时代。所以我可以和朋友,兄弟们一起在户外玩耍,发明属于我们的游戏。

We could be our own heroes, use a twig that would instantly become a bow, a gun, a sword, or a telescope. It could be anything, except maybe a boomerang because once you throw the stick away, you have to go fetch it back.
我们成为自己的英雄,用树枝可以做成弓,枪,剑或望远镜。但除了回旋镖。因为你把树枝扔出去,你需要自己捡回来。

boomerang.png


At some point I grew up, and it became embarrassing to play that way. You can't treat a pinecone as a grenade and pretend to have magical powers when other kids think being an adult is cool. You just don't fit in anymore. You eventually get pressured into growing up. Still, that's a very lucky childhood.
当我长大上面说的游戏变得很幼稚。你不能把一个松塔当成一个手榴弹;假装拥有神奇的魔法;当其他孩子觉得作为一个成年人很酷。你最终会迫于压力而长大。不过总的来说这也是一个非常幸运的童年。

At some point I got the chance to play video games, and to use computers. There could be the imaginary world you had wanted all this time, materialized in front of you. It's consuming you, and for a moment you live a different life.
偶然的一次机会我玩了电子游戏,并使用了电脑。你可能想沉浸在这个突然出现的虚拟世界中,它令你着迷,这一刻你活在不同世界中。

But there's something particular about most video games: you don't create, you react, you consume. I eventually did improvisational theatre as a teenager. Then, again, it was okay to be with people and create and pretend out of nothing.
大多数电子游戏都有其独特之处:你不能创造,只能回应,消耗你的时间。我在十多岁的时候,参加过'即兴表演'。接着,我又找到可以和人一起发挥创造,无中生有的地方。

improv.png


Of course, improvisational theatre in Quebec is different; there's an ice rink in there — everything's hockey.
当然,在魁北克的即兴表演很不同;那里有溜冰场 ——一切都是曲棍球

When I got to a vocational college to study multimedia from 2005 to 2008, I eventually tripped into programming work. I found it amazing! Creativity was there again, and it could get me money! I then designed the mechanism of my first game, and it blew my mind.
2005到2008年间,我在一所职业学校学习多媒体,但是我最终却从事'编程'工作。我觉得编程很棒!我可以发挥我的创造性,同时又可以挣钱!之后我做了我的第一个游戏,让我大吃一惊。

game.png


That's not a real video game, I was told. That's just an HTML form. You should have used an array for the text and options it would have been better. The code needs cleaning up.
"这不是一个真正的电子游戏。"别人跟我说:"这只是一个 html 的表单,你应该将文本和选项放到一个数组中。而且代码需要简化。"

I was a bit disheartened; the game was really about the 11 pages of text I had written for the "choose your adventure" aspect of it. But I realized that if I wanted to make stuff more people thought was good, I'd have to learn a lot.
我听了有些沮丧,这个游戏是我为“选择冒险”方向写的 11 页文字。但我意识到如果我想做出被人们认可的东西的话,我还需要学习更多知识

I'd have to learn "real programming". Move from JScript in a GUI toolkit to something better, like PHP. So I learned that, along with Javascript. Then eventually I was told to learn how to do real programming again; PHP is terrible. I was told to maybe try Python, which I then learned.
我必须要学习真正的编程。从 GUI 工具集里的 JScript,转到更好的语言:像 PHP(谁是最好语言? )。所以我先学习了 Js,后来又去学习 PHP,但是一切并不是很顺利,最终我被告要重新学习真正的编程;PHP 很可怕。告诉我去试试 Python。最后,我选了 Python。

But real programmers knew fancier stuff, and python's lambdas didn't cut it, object-oriented programming was not where you wanted to be. Reading SICP would be the next good step, I was told, because it was like the bible of computer science.
但真正的程序员知道更复杂的东西,像 Python 未阉割掉的 Lambda,面向对象编程也让我云里雾里的。后来别人建议我去读下《计算机程序的构造和解释》,因为它是编程的基础入门圣经

sicp.png


That got me to Scheme. And I got the K&R book because real programmers in the real world did C, and I registered for part time classes at my local university while juggling them with work, because real programmers knew data structures and math, which I learned to some extent. I started reading papers and books, because real programmers stayed up to date and knew fancy algorithms.
就这样,我知道了 Scheme,后来我又去学习 K&R 的书(《C程序设计语言》) ,因为在真实世界中真正的程序员都用 C,同时我旁听了我们学校的计算机课程,跟着他们一起学习。因为,真正的程序员都知道数据结构和数学,但是这些我只略懂皮毛。我开始阅读论文和书籍,因为真正的程序员会跟上时代,并且知道些酷炫的算法。

Somewhere through that I picked up Erlang and started making a career out of it. I wrote a book on it. Curiously enough, nobody ever questioned if I were a real author, or a real writer, or a real illustrator. Hell, I got a job teaching Erlang without ever having used it in a production system.
经过一段时间,我掌握了 Erlang,从而开始了我的职业生涯。我还写了一本关于它的书。十分奇怪的是:从未有人质疑我是真正的作者,作家或插画家。见鬼,我这个没有用 Erlang 做过任何生产级别开发的人,却得到了一份教 Erlang 的工作。


Chapter 2
第二章


So I lived my life flying around the world, telling people how to do things I had sometimes never done myself, while everyone suddenly seemed to believe I was a real programmer because of things I did that were mostly not related to programming in the first place.

One day, I was stuck in an airport coming back from a conference, furiously typing at a terminal, when an odd, gentle voice asked me:

If you please, design me a system!

What?!

Design me a system!

I looked up from my screen, surprised by the request. I looked around and saw this kid who aspired to be a developer and wanted me to call him "printf", which I felt was very stupid and gimmicky. He looked a bit like this:

little printf, with a red and yellow tuque, similarly colored scarf, green coat, red mittens, and beige-yellow pants, standing in snow with a broken laptop at his sides
I don't know computers much yet, but it seems you do. I want to write programs and blog about them and have people use and read them. Please, design me a system!

Now that was a surprising request, and I had been awake for 20 hours by then, not too sure I fully understood or felt like it. I told him systems were hard. I didn't know what he wanted to do, how he wanted it to fail, how many readers it should support, where he'd want to host it, and I could therefore not design a proper system with so little information.

That doesn't matter. Design me a system.

So I made the following architecture diagram:

somewhat complex architecture diagram
He looked at it and said No, this system is not good enough. Make me another.

So I did:

a rather complex architecture diagram
and I gave him a rundown of how it would work.

My new friend smiled politely. That is not what I want, it's way too complex and does a lot of stuff I don't need

I felt a bit insulted, having considered redundancy, monitoring, backups, caches and other mechanisms to reduce load, external payment processor for legal protection, failovers, easy deployment, and so on. I could have charged decent money as a consulting fee for that! Out of patience, I just drew this:

a black box with the text 'enjoy!' written under.
And I added: this is your design. The system you want is inside the black box, hoping this shitty answer would have him leave me alone. But I was surprised to hear back:

That is exactly the way I wanted it!

And that is how I made the acquaintance of the little printf.


未完待续





预知更多神文请看:


如果喜欢,别忘了评分


                               
登录/注册后可看大图


如此多懂学习的VIP至尊已订阅本专辑,你还不快点行动!(☞订阅传送门 )

本帖被以下淘专辑推荐:

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
最佳答案
40 
发表于 5 天前 | 显示全部楼层
原来这才是程序员
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
最佳答案
0 
发表于 前天 11:51 | 显示全部楼层
原来这才是程序员
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1

GMT+8, 2020-10-23 05:29

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表