Code Nation. Michael J. Halvorson

Чтение книги онлайн.

Читать онлайн книгу Code Nation - Michael J. Halvorson страница 24

Автор:
Жанр:
Серия:
Издательство:
Code Nation - Michael J. Halvorson ACM Books

Скачать книгу

to use every instruction at least once.”2 As you are learning the syntax and architecture of a new chip, Gates advised, “go through the instruction set… and look closely at the instructions you seem to use very rarely.” He suggested that successful programmers will continually search for better commands and more efficient ways to solve their problems. But in the final routines, when efficiency is the most pressing concern, it was important to flip the strategy and “use the least number of instructions possible to perform each function.” Finally (and I love this recommendation as a technical writer), Gates cautions that one should not trust the instruction books on programming too much, because they sometimes neglect important shortcuts.3 Programmers, in other words, should learn by doing, internalizing every aspect of the instruction set and hardware features until they are deeply engrained in the coding psyche. This sentiment would eventually become a mantra of the learn-to-program movement.4

      As the team of students completed their work, Bill Gates wrote out the assembly language Assembly languageroutines routines for the interpreter on yellow legal pads, drawing explanatory charts to document what was happening in computer memory.5 Paul Allen and Davidoff, Monte Monte Davidoff also collaborated at this stage, competing with Gates to make the code as tight as possible. At one point, Gates called owner Ed Roberts at MITS to ask how the BASICAltair BASIC Altair processed characters typed on a keyboard, because they had no access to the actual Altair device.6 Finally, the group typed the program into Harvard’s DEC PDP-10 PDP-10 minicomputer using a console display and a keyboard. The PDP-10 was running a software emulator program designed to mimic the Altair microcomputer, created by Paul Allen. When Gates, Allen, and Davidoff finished inputting and debugging their program, they tested its operations by keying in several BASIC programs—the types pioneered by Kemeny and Kurtz at Dartmouth College over a decade earlier.

      The programmer-entrepreneurs then used the PDP-10 to create a spool of punched paper tape containing the completed BASIC interpreter. (See Figure 3.1.) Allen flew to Albuquerque, New Mexico, and fed the punched tape into the Altair test machine at MITS, establishing what would become the first commercial high-level programming language for a PC.7 The entire process took a little over 8 weeks. In the coming years, the nascent Micro-Soft team (later Microsoft) adapted their solution to work on computer systems with different hardware characteristics, expanding the interpreter’s abilities as microcomputers and PCs became more powerful. They applied the same basic approach as they managed system resources for operating systems. (See Figure 3.2.)

       figure

      Figure 3.2Gates, BillBill Gates and Paul Allen pose for a portrait at Microsoft in 1984. Behind the programmers is a white board with illustrations of computer memory, including a plan for allocating resources in an IBM PC that contains 64KB of RAM. (Photo by ©Doug Wilson/CORBIS/Corbis via Getty Images)

      As this example demonstrates, there is more than meets the eye to building non-trivial computer programs, and much of the process takes place well before the programmer loads the code into memory and actually runs the program. The emphasis here is on Teamwork teamwork, and it serves as a corrective to the misconception that Programming programming is usually the work of a solitary coder sitting alone in front of a computer screen.

      Conceptually, programming involves refining Algorithms algorithms, the ordered collections of steps that are proposed to automate processes and solve problems elegantly and efficiently. Some algorithms are limited in scope, like the eight or ten steps that might be necessary to receive contact information from a user and store it in a computer file. (To complete this task, an algorithm might prompt the user for a name and address, assign the input to temporary variables, check the variables for suitable content, format the content, and then insert the information into a database at the appropriate location.) Algorithms Algorithms can also be incredibly complex, such as the comprehensive searching and sorting schemes that Google uses to sift through data gathered from the World Wide Web, then present this information to a user via a commercial web Programming C; C++ browser.

      Systematic attempts to teach programming must somehow train students to become proficient in coding skills, the use of algorithms, debugging techniques, and other important abilities. To appreciate how this relatively obscure problem-solving process became a popular movement, we turn now to the proliferation of programming languages in the 1950s, and the development of an extremely successful programming Computer language language, Formula translation (FORTRAN) FORTRAN.

      In 1981, computer programming pioneer Sammet, Jean Jean Sammet observed that, by her count, there were already some thousand computer languages in the U.S.8 The proliferation of languages was not new, nor was it tied to the development of PCs. In fact, 20 years earlier there were already so many languages in use on mainframe computers that the journal Communications of the ACM published a “Tower of Babel” image on its January 1961 cover. (See Figure 3.3.) The image depicted the mythical tower-to-heaven structure described in the biblical book of Genesis, glossed with the names of dozens of computer languages on the mythical tower’s rings. The artwork recalls earlier critiques of “progress” in America’s social and political history, and it may also poke fun at the hubris of software industry officials for propagating so many compilers. (Human hubris is a pressing concern of the Genesis narrative.)

      In fact, the task of learning to program has sometimes been explained as a simple process of picking a computer language and learning all its features, as if mastering a language’s grammar is the same thing as learning to think logically, or to understand how a computer processes information. As we observed earlier, however, software development involves much more than simply learning the syntax of instructions, as important as that may be. Jean Sammet captured the importance of Language syntax language syntax when she commented: “In the last analysis [language choice] almost always boils down to a question of personal style or taste.”9 In other words, the syntax of languages is interesting, but much in the differences between systems is simply a matter of fashion or technical culture.

       figure

      Figure 3.3Communications of the ACM “Tower of Babel” Cover Image (January 1961), depicting the multiplication of computer programming languages (Courtesy of the ACM) Association for Computing Machinery (ACM)

      So where did all the languages come from and why do programmers propagate them?

      As I noted earlier, the first electronic computers did not utilize software or what we now call “programming” at all. They were hardwired devices that performed individual tasks, such as calculating the trajectory of a rocket. If you wanted to change the problem being computed, you didn’t modify the software, you changed the wiring to accommodate the problem. By hand.

      An example of this type of device is the so-called Atanasoff–Berry Computer Atanasoff–Berry Computer, conceived in 1937 to solve linear equations, one problem at a time. The computer was assembled over a 5-year period at Iowa State College. When it was finished, the machine could be set up to solve two linear equations with up to 29 variables. This was impressive work and the results were highly valued by the Iowa State Physics Department. But in this context the device was essentially a single-purpose computer that specialized in linear equations.

      One of the first programmable computers was the ENIACENIAC computer, designed by John Mauchly and J. Presper Eckert at the University of Pennsylvania. Dedicated in 1946, the ENIAC utilized sophisticated wiring, 18,000 vacuum tubes, panels of switches, and punched-card equipment for input and output.

      The

Скачать книгу