分享

如果编程语言比作武器

 遇见数学 2020-10-31

译自网络, 地址见阅读原文

如果把编程语言喻成武器, 大家姑妄看之开口一笑. 

C语言

C is an M1 Garand standard issue rifle, old but reliable.

C 是经典的M1半自动来复步枪,虽然有些时日了但依旧可以信赖。

C++

C++ is a set of nunchuks, powerful and impressive when wieldedbut takes many years of pain to master and often you probably wish you wereusing something else.

C++ 是双节棍, 看看大师们在挥舞时候的威力就明白了. 但问题是需要很长时间才能掌握它, 在此期间你会非常找其他的代替品. 

Perl 语言

Perl is a molotov cocktail, it was probably useful once, but fewpeople use it now.

Perl 是莫洛托夫燃烧弹, 偶尔会有用武之地, 但现在用的人已经很少了. 

Java

Java is a belt fed 240G automatic weapon where sometimes thebelt has rounds, sometimes it doesn’t, and when it doesn’t during firing youget an NullPointerException, the gun explodes and you die.

Java 就像240发的全自动机枪, 在子弹没有打完之前可以扫荡一切. 一旦弹夹空了, 就会遇到空指针异常, 你也会跟着一起完蛋. 

Scala

Scala is a variant of the 240G Java, except the training manualis written in an incomprehensible dialect which many suspect is just gibberish.

Scala 就是变异的 Java 机枪, 但不同的是它的说明书写的苦涩难懂, 并且很多地方还是胡说八道. 

JavaScript

JavaScript is a sword without a hilt.

JavaScript 是没有剑柄的双刃剑. 

Go

Go is the custom made “if err != nil” starter pistol and aftereach shot you must check to make sure it actually shot. Also it shoots tab sinstead of blanks.

Go 就自己的 “if err != nil” 语法特性的手枪, 每次开枪后都要再检查下是否真的开过了, 并且它只发射 Tab. 

Rust

Rust is a 3d printed gun. It may work some day.

Rust 是 3D 打印出来的枪, 或许那天就能用上吧. 

Bash

bash is a cursed hammer, when wielded everything looks like anail, especially your thumb.

bash 是被下了诅咒的锤子, 当你挥舞起来, 满眼之内都是钉子, 包括你自的手指头. 

Python 语言

Python is the “v2/v3” double barrel shotgun, only one barrel will shoot at a time, and you never end up shooting the recommended one. Also I probably should have used a line tool to draw that.

Python 是双管枪, 一次只能开火一次, 你也不知道什么时候另一发什么会开火. 或许我未来会用来当做画直线的辅助工具. 

Ruby

Ruby is a ruby encrusted sword, it is usually only used becauseof how shiny it is.

Ruby 是嵌了红宝石的宝剑, 上面的烁烁发光这才是会使用它的原因. 

PHP

PHP is a hose, you usually plug one end into a car exhaust, andthe other you stick in through a window and then you sit in the car and turnthe engine on.

PHP是一根管子, 一头连着汽车尾气管, 另一头透过插床插在车内, 然后坐在车内启动了汽车引擎. 

Mathematica

Mathematica is a low earth orbit projectile cannon, it couldprobably do amazing things if only anyone could actually afford one.

Mathematica 是一颗环绕地球低轨道的加农大炮, 威力非常大, 但前提是能负担起它的费用.

C#

C# is a powerful laser rifle strapped to a donkey, when taken off the donkey the laser doesn’t seem to work as well.

C# 是搭载驴子上的激光来复枪, 但如果卸载下来的话, 就不能继续使用了. 

Prolog

Prolog is an AI weapon, you tell it what to do, which it does but then it also builds some terminators to go back in time and kill your mom.

Prolog 是一种智能武器, 你告诉它要做什么, 它除了完成你吩咐的事情, 还制造出终结者来, 也把你干掉. 

Lisp

Lisp is a shiv which comes in many forms. Anyone who uses this is probably crazy and dangerous.

Lisp 是多样灵活的螺丝刀, 使用它的人往往可能疯狂且危险. 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多