在此收集程式語言流行漫畫,略作整理。
GIT THE PRINCESS!
標題本應為GET,而GIT是一個被程式設計人員廣泛使用的版本控制工具。
副標題為:How to save the princess using 8 programming languages?(如何用八種程式語言拯救公主?)
JavaScript
- You have JavaScript.
- You spend hours picking libraries, setting up Node & building a framewrok for the castle.
- By the time you’re finished with the framework, the fort has been abandoned and the princess has moved to another castle.
- 你擁有Javascript。
- 你花費大量時間挑選庫(類似工具箱),安裝Node(非瀏覽器運行環境)以及搭建一個城堡的框架。
- 當你搭完框架,這個堡壘已被拋棄而公主已經轉移到另一個城堡。
按:諷刺JavaScript層出不窮的流行框架。
C
- You have C.
- You have a library for a castle & a library for the princess. Charge!
- You rescue the princess, her dog, her entire wardrobe & everything she has ever eaten… Fudge! Did I forget a null-terminator?
- 你擁有C。
- 你分別擁有一個城堡和公主的庫。衝鋒!
- 你救出公主,她的狗,她的整個衣櫃以及一切她吃過的東西⋯Fuck(操)是因為我少了一個空字符?
按:C靠近底層。
C#
- You have C#.
- You spend hours tring to express the entire rescue in a single LINQ query.
- You give up and go to Stack Overflow to have Jon Skeet rescue the princess for you.
- 你擁有C#。
- 你花費大量時間用於試圖使用簡單的LINQ(語言整合查詢)查詢方法去解釋整個營救方案。
- 你放棄了,去Stack Overflow(程式交流問答網站)讓Jon Skeet(擅長回答有關C#問題)替你營救公主。
按:複雜。
Java
- You have Java.
- You quickly deploy the rescue to production.
- You discover you’ve loaded two versions of the castle, but no princess.
- 你擁有Java。
- 你迅速將營救部署到生產環節。(意將營救方案付諸實施)
- 你發現你載入了兩個版本的城堡,但公主不在裏面。
按:過時。
Lisp
- You have Lisp.
- 你擁有Lisp。
按:Lisp是第二古老的語言,也是這裏面唯一的函數式語言,以其怪異的邏輯與眾多的括號為大眾所熟知。圖中諷刺的正是這兩點。但需要注意的是在這個系列中成功解救出公主的只有C與Lisp,而後者常被神話。一個蘇聯笑話:特工從美國人工智能實驗室偷來最後幾頁程式碼,帶回蘇聯,打開全是括號。
Go
- You have Go.
- We don’t support freeing captured princess, we already have these free princesses in the standard library… Wait, is this the princess from the Java panel?
- 你擁有Go。
- 我們不支持拯救被困的公主,我們在標準庫中已經有這些自由的公主們。等等,這個公主是來自Java面板?
按:難取代Java。
Pascal
- You have Pascal.
- You declare your princess, castle & rescue plan.
- Then you go for a drink & forget about the implementation.
- 你擁有Pascal。
- 你宣布你的公主、城堡和營救方案。
- 然後你出去喝了一杯,忘掉了付諸實施的事。
按:龍鍾老態。
PHP
- You have PHP.
- You have to rescue the princess… in PHP…
- 你擁有PHP。
- 你得去營救公主,且使用PHP
按:PHP為眾所週知設計糟糕的語言,這與其文檔中自稱「最好的語言」產生反差。
GIT THE DRAGON!
姊妹篇,副編題為:How to kill the dragon using 9 programming languages?(如何用九種程式語言屠龍?)
Python
- You have Python.
- Everybody marvels at your awesome dragon slaying tools.
- You discover your tools are only for slaying a snake.
- 你擁有Python。
- 所有人都在為你可畏的屠龍工具而感到震驚。
- 你發現你的工具只能屠蛇。
按:精緻的玩具。
Swift
- You have Swift.
- You’ve got an NSDragon class, but you need to write an 500 loc extension to implement slaybility.
- Just as you’re almost done, Apple releases another dragon.
- 你擁有Swift。
- 你得到一個NS(前綴,來自NeXTSTEP庫)龍類,但你需要寫一個500行的本地擴展去實現屠殺。
- 就在你幾乎完工之際,蘋果放出一條新龍。
按:蘋果的風格。
CSS/HTML
- You have CSS/HTML.
- You try to cover the dragon with a highly frammable blanket.
- Now everything’s on fire (also, the vertical center has failed).
- 你擁有CSS/HTML。
- 你試圖用一條極易燃的毯子蓋住龍。
- 現在一切都著火(包括垂直居中也失效)。
按:垂直居中失效,意味著無法蓋住龍,即屠龍無效。
Scala
- You have Scala.
- Your horse has crashed.
- 你擁有Scala。
- 你的馬已經垮了。
按:馬身上字為:「You horse has stopped working: Send & Don’t send.」(你的馬已經不再工作:發送/不發送)。
C#
- You have C#.
- You set all references to the dragon to null. The dragon seems gone.
- But with non-deterministic garbage collection, can you ever be sure the dragon is really gone?
- 你擁有C#。
- 你把所有關於龍的參考資料設置成空。龍看起來不復存在。
- 但在非確定性垃圾回收中,你真的曾經確定龍已經不復存在?
按:掩耳盜鈴。
Cobol
- You have Cobol.
- You go from village to village fighting the same dragon over and over.
- You make a fortune in the process.
- 你擁有Cobol。
- 你從一個村莊到另一個村莊,和同一條龍打架,一遍又一遍。
- 在這個過程中你掙了一大筆錢。
按:Cobol現僅存於商業領域。
Lua
- You have Lua.
- It’s an incredibly fast and effective weapon… But you’re out of ammo.
- Mike Pall has the last bullets, but he’s gone & you don’t know his real name or even what he looks like.
- 你擁有Lua。
- 這是一個難以置信地迅捷且高效的武器⋯但你已經用光了彈藥。
- MIke Pall(Lua社區的傳奇人物)擁有最後的彈藥,但他已經離開而你不知道他的真實名字,甚至長相。
按:小眾。
Haskell
- You have Haskell (and a monad).
- You implement a monad to encapsulate the dragon killing side-effect. The villages are concerned and urge you to stop, but you say it’s OK cause a monad is just a monoid in the category of endofunctors, so you don’t see what the problem is.
- You need help.
- 你擁有Haskell(和一個單子)。
- 你用一個單子去概況屠龍副作用。村民們非常擔憂並讓你停下,但你說沒有關係因為一個單子只是一個自函子目錄中的單子,所以你們不會發現問題。
- 你需要幫助。
按:和Lisp類似,Haskell是函數式語言,以其來自數學抽象的概念與晦澀的邏輯為公眾所知悉。函數式語言致力於消除副作用,常基於美學需求而非現實考量,圖中諷刺的正是這點。
CoffeeScript
- You have CoffeeScript.
- You don’t have dragon slaying powers so you drink it to get good.
- You died.
- 你擁有CoffeeScript。
- 你沒有屠龍的能力,所以你喝下去希望變好。
- 你死了。
按:CoffeeScript是JavaScript的拙劣模仿者。
HOW TO BUILD A HORSE WITH PROGRAMMING
如何使用程式語言造出一匹馬。
C++
- You build a horse.
- It’s ugly as hell and has lots of dangling parts, but it gets the job done.
- 你造出一匹馬。
- 牠奇醜無比並且有一堆懸掛的零件,但好歹完成了工作。
按:確實能用。
Java
- You really want to build a horse.
- But first you need to build a horse factory.
- 你真的想造出一匹馬。
- 但你先得造出一個生產馬的工廠。
按:解決一類問題。
JavaScript
- Your horse arrived in different packages.
- You built the horse, but the backbone came out angular, so the horse is paralyzed.
- 你收到馬的各個部件。
- 你造出馬,但馬的脊椎骨反了,所以這匹馬得了麻痺症。
按:庫良莠不齊。
NoSQL
- You had a fast beautiful horse.
- But you have no idea here it is.
- 你有一匹漂亮的快馬。
- 但你不知道牠在哪。
按:索引。
Cobol
- You build the horse in 1962.
- It can only be tamed by the original creator, For all other purposes it’s a dragon.
- 你在1962年造出這匹馬。
- 牠只馴服於最初的創造者,其他的企圖會讓牠變成一條惡龍。
按:沒聽說過。
Lisp
- You built a (((…)))
- 你造出一匹(無數括號中的馬)
按:括號。
C#
- The horse works best when dressed in a camel costume.
- When you try to use it as anything else than a camel, it gets a bit fussy.
- 這匹馬只能在駱駝套裝中才能發揮最佳功效。
- 當你試圖去讓牠做駱駝以外的事情,牠會有點困惑。
按:語法糖。
Assembly
- The horse turns out a little basic.
- But boy can it run.
- 這匹馬看上去有點原始。
- 但男孩子能讓牠跑起來。
按:彙編語言最靠近底層。
PHP
- You built a Trojan horse.
- It releases hundreds of tiny horses to punish you every day, forever.
- 你造出一匹特洛伊木馬。
- 牠放出成百上千的小馬每天痛擊你,直到永遠。
按:糟糕的設計。
IT JOBS EXPLAINED WITH A BROKEN LIGHTBULB
用一個不亮的燈泡來解釋IT工作。
IT Support
IT支持
- The lightbulb is broken.
- Tries turning it off & on again.
- Room is still dark, orders new room from stock.
- 燈泡不亮。
- 再一次試著關上並打開開關。
- 房間依舊漆黑,從庫存中預定一個新房間。
按:技術人員。
Front-End Developer
前端開發者
- The lightbulb is broken.
- Covers lightbulb with yellow paint.
- Tells backend that lightbulb works, but only during the day.
- 燈泡不亮。
- 給燈泡塗上黃漆。
- 告訴後端這個燈泡正常,不過只能在白天工作。
按:即設計網頁、提供交互的開發者。以其遠離核心業務,地位較低。
Project Manager
項目經理
- The lightbulb is not broken.
- Fixes lightbulb with baseball bat.
- Lightbulb is now broken, frontend gets ticket.
- 燈泡沒壞。(被前端塗漆)
- 用球棒修理它。(徹底打碎)
- 燈泡現在徹底壞了,前端得償所願。
按:皆大歡喜。
Marketing
營銷
- The lightbulb is broken.
- Convinces you that dark is the new light.
- Leaves you to read blog posts, goes back to playing candy crush.
- 燈泡不亮。
- (營銷人員)說服你黑暗是一種新光。
- 讓你去讀部落格上的文章,回去玩糖果傳奇遊戲。
按:銷售人員。
Lead Generation
用戶開發
- The lightbulb is broken.
- Bring in more lightbulbs.
- And more.
- 燈泡不亮。
- 帶回來更多的燈泡。
- 還有更多。
按:引導性銷售。
Content Marketing
內容銷售
- The lightbulb is broken.
- Has no idea how to fix it.
- Writes a 2,000 word expert’s guide to changeing a lightbulb.
- 燈泡不亮。
- 不知道如何修理。
- 寫一篇兩千字的專家文章教你如何更換燈泡。
按:流量轉化利潤。
Operations
運營
- Gets paged to fix lightbulb at 2 A.M.
- Hands out flashlights.
- Goes back to sleep.
- 凌晨兩點被傳呼修理燈泡。
- 交接手電筒。
- 回去睡覺。
Backend Developer
後端開發者
- Wonders why everybody’s having problems with lightbulbs.
- Realizes he forgot to deploy light to database.
- Keep calm & blame frontend.
- 奇怪為什麼所有人都有燈泡問題。
- 發現是他自己忘記將燈泡部署到數據庫。
- 保持冷靜,把責任推給前端。
按:後端開發者,以其接觸核心業務,地位較高。
IF THE WORLD WAS CREATED BY A PROGRAMMER
程式設計師之創世紀。
創世之初
- In the beginning, there was the Heven and the Earth.
- But the earth was formless and buggy, & without documentation.
- And the programmer saw that it was not good.
- 最開始,有天國和地球。
- 但是地球尚未成型而且充滿錯誤,以及沒有參考文檔。
- 程式設計師知道這一切不好。
按:創世紀。
要有光
- Then you said, “Let there be light!” But the light did not compile.
- You create a hack so that light is part of the land.
- To create darkness, you need to hide the land, but that’s OK cause creatures won’t be added until later. And Stack Overflow said it’s find.
- 然後你說:「要有光。」但光不能編譯。
- 你破解了這個問題,於是光成了大地的一部分。
- 要製造黑夜,你需要隱藏大地,這沒有太大問題畢竟所有生物要到後期才會添加進來。而且Stack Overflow說這樣沒事。
洪水
- On the second day, you merge water.
- But because of the dependency, light breaks as land is accidentally flooded. You check Stack Overflow (in the darkness).
- 第二天,你合成水。
- 但由於依賴性,大地遭遇洪水時,光也隨之消失。你在Stack Overflow上尋找解決辦法(黑暗中)。
造物
- It’s the third day, turns out the creatures needed to be added sooner, but the client forgot to mention that.
- You try to add creatures in the darkness, but there’s no land without light, and you can’t have light because of the water.
- You add them in the browser using cookies, which unfortunately makes them mortal.
- 第三天,看起來要儘快添加生物,但客戶端忘記說這件事。
- 你試圖在黑暗中添加生物,但沒有光就沒有陸地,而且因為洪水你不能有光。
- 你用Cookies(小型文字檔案)將生物添加在瀏覽器中,這意味著牠們最終會死。
按:Cookies是瀏覽器記錄用戶身分信息的文字檔案,隨著瀏覽器關閉而消失,其存在週期是短暫的,圖中用以類比生命。
地球
- It’s the forth day, turns out the issues were caused by the flat earth design.
- You decide to use C++ to create a balloon that inflates the Earth.
- You also use STL for abstractions, and it works out great with no complications whatsoever!
- 第四天,看樣子問題是由扁平地球的設計所導致的。
- 你決定用C++製造一個氣球來撐起地球。
- 你也用STL(標準模板庫)來構造抽象,它出色完成任務且無論任何事都不再有困難。
第五天
- It’s the fifth day, you start adding people to help you.
- You decide to create them in your likeness, which is a mistake. They immediately populate the Earth with hacks, fads and unnecessary JavaScript Libraries.
- 第五天,你決定創造人類來幫助你。
- 你決定用你的樣子來創造他們,這顯然是一個錯誤的決定。他們迅速佔據地球,充斥大量的破解、流行以及不必要的JavaScript庫。
按:海豚身上jQuery是一個函數庫,React等是新興的JavaScript函數庫,諷刺前端過剩的創造能力。
第六天
- On the sixth day you look at the chaos you created.
- You attempt to lead people back to sensible programming, but it is too late. Everything runs on dependencies.
- 第六天你審視著你製造的混亂。
- 你試圖讓人們回歸到理性編程上去,但已經太遲。一切事物的運行均存在依賴。
按:圖中庫並不存在,只為調侃。作者在所有正常名稱後面都加上js後綴(表示其為JavaScript函數庫)。
第七天
- On the seventh day you really want to rest, but you need to organise all you’ve created.
- MongoDB
- 第七天你真的想要休息,但你需要組織好你創造的一切。
- MongoDB(数据库管理系统)。
後記
任何高階程式語言都是對最底層都是對最底層機器指令(0與1)的抽象和封裝,從這個角度,沒有什麼是最基本的,只有什麼是最適合的,這正是世上流行著名目繁多而又大同小異的程式語言的原因。語言本身沒有任何神奇之處,它能實現複雜的功能,歸因於背後的數理基礎,遺憾的是這正是所有黑客所缺少的。不明就裡,而產生工具崇拜,以上漫畫莫不如此。這些論戰會持續下去,在我看來,無異於中世紀的鐵匠在領主面前炫耀自己的銼刀,我想我沒有時間或意願參與這種遊戲。
這個世界上或許有千萬種知識,唯獨沒有程式語言知識,以其廉價;同理或有千萬種技術,唯獨沒有互聯網技術,以其短促。這是互文見義的,兩者共同具有主觀任意性,為左派文化的延伸:他們本身不創造價值,只增加一些流通環節;提供一點可有可無的便利,卻在侵噬公眾的自由——這是比浮士德更愚蠢的交易。