When someone tells you they code, it’s as if they’re calling you from inside the world’s most exclusive club. It’s probably a pretty great party in there, but you’ve got no idea how they got on the guest list and you’re fairly sure that even if they came out, floored the bouncer and physically carried you in, the bar staff would spot your trainers and you’d find yourself back on this side of the door in ten minutes. Like speaking Chinese or perfecting the moonwalk, coding is just one of those things you’ll never be able to do.
This, of course, is a complete myth. There’s nothing stopping you learning to code. In fact, you could start right now. Go on - don’t even read to the end of this post. Click here instead. You’ll have written your first lines of code before you next check Facebook. Or here if you want to make a website. Or here if you fancy giving an iPhone app a go. Like most things, getting started turns out to be as simple as Googling it and clicking on the first link that’s not an ad. Every coder out there has to start from square one at some point.
But you’re not really starting from square one. Because really, deep down, you already know how to do it. Code is instructions. You write the instructions, and the computer follows them. Any time you’ve given someone directions to your house, or typed in a sum on a calculator, or lined up a row of dominoes, you’ve essentially been coding. The person following your directions, you pressing the equals button, knocking over the first domino - that’s the code being run. Coding is pretty much teaching a series of steps to a computer, for the sole reason that it can follow those steps a hell of a lot quicker than you can.
Running your first line of code and seeing it do whatever it was you told it to, you quickly realise this is something you could get used to. Most of us love giving orders, and when you sit down to code you’ve got what amounts to an uncomplaining, untiring, unerring servant literally at your fingertips. Sure, you have to issue your edicts in a fairly precise way - but ask nicely and it will do pretty much anything for you. And learning the language is easier than you might think; you’ll quickly find that amateur coders are probably the third best served group on the internet, losing out only to Google Incognitos and cat-lovers. For literally every problem you come across, someone will have had it before, asked the rest of the world about it, and received an answer that sounds like it’s been taken straight out of a computer science textbook. It’s as if Tim Berners-Lee is sitting in a room somewhere, scouring the Internet for helpless beginners, and answering each of their questions in turn under a different, ill-judged pseudonym. Bless him.
There’s the usual spiel about the astronomical salaries, the free lunches, the wearing hoodies to work - but you already know all that. Everyone has since they made that film about Justin Timberlake going to Harvard. No, a better reason to start coding, one that may trample all over your better judgement, is that it’s fundamentally creative. You just have to look at what some of the tech companies out there are doing - the Twitters and Apples of this world - to see that this much is true. Thinking that coding is the nerdy IT guy at work rebooting your computer is like thinking that music is what happens when the piano tuner comes round.
Let’s be clear - like anything, getting really good is tough. Unless you happen to be a 7-year-old, you’re probably not going to find time to rack up your 10,000 hours. But that’s not what most of us are going for, and it’s certainly no reason not to pick it up. So if you’ve ever thought you’d like one day to give it a go, treat today as that day. Or at least some time this week. Because, basically, you can already do it.
当有人告诉你他们是做编码的,就好像他们在一个高等俱乐部呼唤你。这可能是个规模相当大的聚会,但你并不知道他们是怎么进去的,即使他们走出来,击倒守卫,把你带进去,里面的酒保也会立刻识破你,你将会在十分钟内回到门外。编码就好像像说汉语或者完善太空步那样的事一样,你永远没办法做。
这样的说法当然是谬误。你要是真心想学编码的话,没有什么能阻挡你。实际上,你现在就可以学。继续往下看,甚至你都不用读完,直接点击这的链接,在你查完下一条脸书动态前,一行代码就完成了。你想给弄个网站或者尝试新的苹果应用。所谓的开始对于大多数事情来说就是谷歌一下,然后点击第一个相关链接。每一个编码员都是从这样一步步走过来的。
当然并不是真的从头开始,因为你潜意识里早知道该怎么做。编码就是输入指令。电脑会执行你所输入的每个指令。告诉某人你家的路,用计算机算数,排好多米诺骨牌这些都是指令,你早就开始编码了。那个跟从你指示的人,你所摁下的等于按钮以及推掉的第一个多米诺骨牌,这些都是代码运作的开始。编码相当于教导电脑执行一系列步骤,为什么不自己做呢?因为电脑的运算速度比你快得多。
当你运行你所编写的第一条代码,看着它照着你的设想执行时,你很快就会意识到编码没有想象中那么困难,渐渐就适应了。大多数人喜欢下命令,当你坐在电脑前,对着一个不会抱怨,不知疲倦,从不出错的“仆人”敲击代码,下达指令。当然你必须保证你所下达指令的精确度,然后它就会帮你做任何事。学习语言也是如此,你很快就会发现业余的编码爱好者群体可能是互联网上排名前三的优质服务团队。除了谷歌上的匿名用户和爱猫人士,那些你所遇到的问题,之前总有人碰到过,将之诉诸于网络,从这台科学计算机得到答案,就好像蒂姆·伯纳斯·李(万维网之父)就徘徊在房间里的某个地方,以一个别样鲁莽的身份帮助那些刚接触互联网的菜鸟提炼信息,然后挨个回答他们的疑问,唉,辛苦他了。
人们可能常常会听到有关于天文数字般的薪水,免费午餐,穿连帽衫工作的夸张言辞自从有人拍摄了关于贾斯汀·汀布莱克(美国著名歌手)上哈佛大学的影片。不,这样的编码理由还不够有说服力,一个足以让你丧失所谓理性判断力的理由就是它那天马行空的创造力。看看那些网络技术大公司——推特和苹果,编码的力量可想而知。将编码形容成一个木讷的程序猿在重启你的电脑就好像将音乐当作是钢琴调音师的兴之所致。
开门见山地说,不管什么事想要做精都是很难的。除非你正好是一个七岁的孩子,而且恰好有个一万小时的空闲时间进行专业积累。这当然是无稽之谈,我们不会这么做,也没有理由这么做。但是如果哪天你想尝试一下,就当是今天,或者最迟这星期内。为什么?因为你早就能做了。