第一行代码(英文)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
The First Line of Code
Elena Botella
What was the first line of code? It depends, a bit, on how exactly you define code.
For now, let’s say code is a set of instructions that are given to a machine. Giving instructions to machines is something most of us do all the time. So far this morning, even before I opened my laptop, I flipped a light switch to turn on and off my bath- room lights, pushed a lever to instruct my toilet to flush, and pressed a button to tell my coffee grinder to grind some coffee beans. Each of these individual buttons or switches delivered a single instruction, “on” or “off,” “do” or “do not,” or, shall we say, “1” or “0,” to machines that each knew how to do exactly one thing: emit light, flush water, or grind coffee beans.
Code happ ens when you have a machine that’s ready to listen to not just one instruction, but very long sets of instructions, combining those “on” or “offs,” “1s” or “0s,” “dos” or “do nots” in practically infinite, seemingly magical combinations. And importantly, the difference between code and mere language is that code should always produce the same output given the same input. When I run lines of code, even on a different com- puter than the one I wrote them on, they should always produce the same result.
By this definition, the first code may have been
written by Ba- sile Bouchon in 1725, more than a century before the invention of the electrical generator.
Basile Bouchon was a French weaver, at a time when pat-
terned silks were the height of luxury and of fashion. Before Bouchon, it took several weeks of painstaking and tedious labor (tying knots in the loom strings)
just to reconfigure a loom to
the selected pattern.2 As historian Abbot Payson Usher wrote in 1929, this “work was heavy, the hours long, and serious physical disorders were developed by this most wretched class of silk workers.”3
Bouchon’s solution? The first punch card, or, more
spe- cifically, a very long sheet of paper that would be “coded” by punching holes in the paper. This long sheet of paper was placed underneath a row of needles and gradually unspooled by the weaver. The holes (or lack of holes) in the perforated paper told the loom which needles to retract and which not to retract, which in turn changed the design of the fabric.
In practice, Bouchon’s loom didn’t work very well, and it was never widely used. But even at the time, other weavers could see that the idea held promise. It only took a few years for other people to start making improvements, notably by replacing the continuous roll of perforated paper with sturdier, more versatile punch cards. A few years after that, someone designed a loom that eliminated the need for a human to stand by to switch the punch cards, doing so mechanically instead.
Bouchon wasn’t famous in his own era, but another man, Joseph Marie Jacquard, became rich and famous in the early 1800s for improving upon Bouchon’s design, combining it with other innovations to create what became known as the “Jacquard Loom.”4 Emperor Napoleon Bonaparte was so impressed with Jacquard that, after personally visiting him, he awarded Jac- quard an annual pension and a bonus for every Jacquard Loom manufactured in France.5 Jacquard became a household name, but Bouchon was reintroduced to history books when British academic Reverend Robert Willis wrote that
“the merit of Jac- quard is not . . . that of an inventor, but of an experienced work- man, who by combining together the best parts of the machines of his predecessors in the same line, succeeds for the first time in obtaining an arrangement sufficiently practical to be gener- ally employed,” giving the credit specifically to Bouchon for the use of perforated paper to program the loom.6。