The journey to becoming a developer

My future is created by what I do today, not tomorrow.

Computer Science/Crash Course

Early Programming: Crash Course Computer Science #10

Millie 2021. 10. 12. 09:11

Last episode

지난 에피소드에서는 컴퓨터 작동 방식, 복잡한 회로를 사용해서 메모리에서 값을 저장/검색하고 두 숫자를 더하는 것과 같이 해당 값에 대한 연산을 수행하는 방법에 관하여 배웠다. 

We've even briefly talked about sequences of operations, which is a computer program.

What we haven't talked about is how a program gets into a computer.

In reality, programs have to be loaded into a computer's memory.

에피소드 7, 8에서 만들었던 CPU - 그때는 간단함을 위해 프로그램이 이미 메모리에 있다고 말했지만, 사실은 프로그램을 컴퓨터의 메모리에 로드를 해야 한다. 이것이 Computer Science이다. 

 

Early Programming

The need to program machines existed way before the development of computers.

 

The most famous example of this was in textile manufacturing.

If you just wanted to weave a big red tablecloth, you could simply feed red thread into a loop and let it run.

What about if you wanted the cloth to have a pattern like stripes or plaid?

Workers would have to periodically reconfigure the loom as dictated by the pattern.

But this was labor intensive, which made pattern fabrics expensive.

In response, Joseph Marie Jacquard developed a programmable textile loom, which he first demonstrated in 1801.

The pattern for each row of the cloth was defined by a punched card, with the presence or absence of a hole in the card determined if a specific thread was held high or low in the loom. Such as the cross-thread, called the weft, passed above or below the thread. To vary the pattern across rows, these punch cards were arranged in long chains, forming a sequence of commands for the loom.

Many consider Jacquard's loom to be one of the earliest forms of programming.

Punched cards turned out to be a cheap, reliable, and fairly human readable way to store data.

Merely a century later, punched cards were used to help tabulate the 1890 US Census, which we talked about in episode one.

Each card held an individual person's data, things like race, marital status, number of children, country of birth, and so on.

For each demographic question, a census worker would punch out a hole of the appropriate position.

When a card was fed into the tabulating machine, a hole would cause the running total for that specific answer to be increased by one.

In this way, you could feed the entire county's worth of people and at the end, you'd have running totals for all of the questions that you asked.

Limitations of early tabulating machines

It's important to note here that early tabulating machines were not truly computers.

They could only do one thing: tabulate.

Their operation was fixed and not programmable.

Punch cards stored data, but not a program.

Control panel (Plugboards)

Over the next sixty years, these business machines grew in capability, adding features to subtract, multiply, divide, and even make simply decisions about when to perform certain operations.

To trigger these functions appropriately so that different calculations could be performed, a programmer accessed a control panel.

This panel was full of little sockets, into which a programmer would plug cables to pass values and signals between different parts of the machine. For this reason, they were also called 'plugboards'.

Unfortunately, this meant having to rewire the machine each time a different program needed to be run.

So by the 1920s, these plugboards were made swappable.

This not only made programming a lot more comfortable, but also allowed for different programs being plugged into a machine.

For example, one board might be wired to calculate sales tax, while another helped with payroll.

But plugboard were fiendishly complicated to program.

이 꼬인 선들이 손익의 합을 계산하기 위한 프로그램이다. 이 프로그램은 IBM 402 회계 기계에 사용되었으며 1940년대에 인기가 많았다.

This tangle of wires is a program for calculating a profit-loss summary, using an IBM 402 accounting machine, which were popular in the 1940s.

And this style of plugboard programming wasn't unique through electromechanical computers.

The world's first general purpose electronic computer, the ENIAC completed in 1946, used a ton of them.

Even after a program had been completely figured out on paper, physically wiring up theh ENIAC and getting the program to run could take upwards of three weeks.

Given the enormous cost of these early computers, weeks of downtime simply to switch programs was unacceptable and a new, faster, more flexible way to program machines was badly needed.

Stored program computers

Fortunately, by the late 1940s and into the 50s, electronic memory was becoming feasible.

As cost fell, memory size grew.

Instead of storing a program as a physical plugboard of wires, it became possible to store a program entirely in a computer's memory, where it could be easily changed by programmers and quickly accessed by the CPU.

These machines were called stored program computers.

Von Neumann Architecture

With enough computer memory, you could store not only the program you wanted to run, but also any data your program would need, including new values it created along the way.

Unifying the program and data into a single shared memory is called the Von Neumann Architecture.

The hallmarks of a Von Neumann computer are a processing unit containing an arithmetic logic unit, data registers, an instructional register, and instruction address register.

But finally, a memory to store both data and instructions.

The very first Von Neumann Architecture stored program computer was constructed in 1948, by the University of Manchester, nicknamed 'Baby', and even the computer you're watching this video on right now uses the same architecture.

Now, electronic computer memory is great and all, but you still have to load the program and data into the computer before it can run, and for this reason, punch cards were used.

Punched paper tape

A close cousin to punch cards was punched paper tape, which was basically the same idea, but continuous instead of being on individual cards.

Panel programming

In addition to plugboards and punch paper, there was another kind of way to program and control computers pre-1980 : Panel programming.

Rather than having to physically plug in cables to activate certain functions, this could also be done with huge panels full of switches and buttons, and there were indicator lights to display the status of various functions of values and memories.

최초로 상업적으로 성공한 가정용(개인용) 컴퓨터 ALTAIR 8800

The first commercially successful home computer was the ALTAIR 8800 were sold in two versions: preassembled and as a kit.

To program the 8800, you'd literally toggle the switches on the front panel to enter the binary opcodes and instructions you wanted.

Then, you'd press the deposit button to write that value into memory. Then, in the next location in memory, you'd toggle the switches again for your next instruction, deposit it, and so on.

When you'd finally entered your whole program into memory, you would toggle the switches to be back to memory address zero, press the run button, and watch the little lights blink.

That was home computing in 1975,

Whether it was plugboards, switches, or punch paper, programming these early computers was the realm of experts.

By the professionals who did this for a living or technology enthusiasts, you needed intimate knowledge of the underlying hardware, so things like process opcodes and register to write programs.

This meant programming was hard and tedious, and even professional engineers and scientists struggled to take full advantage of what computers could offer.

What was needed was a simpler way to tell computers what to do, a simpler way to write programs, and that brings us to programming languages, which we'll talk about next episode.

 


프로그래밍 언어라는 것이 없던 시절의 초기 프로그래밍은 어떤 식으로 수행되었는지에 대해서 알아볼 수 있는 영상이었다. 간략하게 영상을 보기만 해도 정말 복잡해 보였다. 최초의 가정용 컴퓨터조차 매우 사용하기 어려웠다는 것. 그래서 컴퓨터가 무엇을 해야하는지 말하는 것, 즉 프로그램을 간단하게 짤 수 있도록 프로그래밍 언어가 도입이 된 것. 

만약 프로그래밍 언어가 발명되지 않았다면, 과연 지금 프로그래밍이 이렇게 대중화될 수 있었을까? 그러기 어려웠을 것이다. 

프로그래밍에 대한 역사를 알아보니 지금의 프로그래밍이 다르게 보인다. 어떤 것에 대해 역사를 알게 되면 그것이 더 입체적으로 보이게 된다.