---
layout: post
title:  "A \"Short\" History on Computers"
date: 2018-06-21 9:56:34 +0800
author: foo-dogsquared
categories: general
tags: [programming-notes, computer-science, real-notes]
---

With another alt title of "DO YOU REALLY NEED TO READ SOMETHING LIKE THIS"?!!

For those who are uninitiated, these are from the immortal words of 
the (in)famous Apple kid from [*this commercial*](https://www.youtube.com/watch?v=sQB2NjhJHvY).

But anyway, we're not focusing on how much anger the online community has gathered from the commercial but we're focusing 
on the infamous quote and take a closer look on the subject of the said quote.

## What is a computer?
Well, moving on to a formal definition from [Computer Hope](https://www.computerhope.com/jargon/c/computer.htm). A computer is:
> an electronic device that accepts data (input), processes that data, produces output, and stores (storage) the results

Aaaaaand another definition from [Wiktionary](https://en.wiktionary.org/wiki/computer) because why not.
> a programmable electronic device that performs mathematical calculations and logical operations, especially one that can process, store and retrieve large amounts of data very quickly

Either way, the given definitions are pretty similar to each other. A computer is a device that can be programmed to perform a
series of steps such as mathematical calculations, logical operations, and hardware communication in order to give a solution.
Well, we can actually level up (or down, depending on how you interpret it) that defintion by taking the general definition 
of one of the more famous dictionary out there, Mirriam-Webster's:
>  one that computes

Yeah, any device that computes. Aside from the usual things we imagine whenever we hear the word "computer" like laptops, 
smartphone, and PC, there's also the gaming consoles, smart TV, smart glasses, smart fridge, smart home, calculators, 
automated doors, music player, bluetooth earphones, a computer that can give out a list of things that are considered to be 
a computer, and so much more and will continue to expand until the end of time.

## Almost Necessary History Lesson of Computers
As said by [somebody](https://en.wikipedia.org/wiki/Carl_Sagan), one must know the past to understand the present. 
And that's what this section is about, obviously.

Hopefully, this will answer some of the questions you might have whenever you use a computer: how does this dumb box work, 
why computers and computer scientists love to use binary systems, why do we even need a computer for stuff when we can 
just do it by hand or, how our computers today end up like this.

### Back when computers are mostly people
As most history lessons on computer would do, let's go into discussing abacus which is one of the very first tool for 
computations. This benefits the early civilizations that utilized it by helping them count and calculate large numbers at least 
up to hundred thousands or so.

Then as the civilizations rises economically, so does the need for computing as more of these computing devices have been invented 
to compute faster and count higher: [Napier's Bones (1617)](https://en.wikipedia.org/wiki/Napier%27s_bones), 
[the slide rule (1632)](https://en.wikipedia.org/wiki/Slide_rule), and other stuff in between.

But let's stop in an era that utilizes machines wherein one of the first working mechanical calculator invented by 
[Blaise Pascal](https://en.wikipedia.org/wiki/Blaise_Pascal) in 1642. That mechanical calculator? The *Pascaline*. It only 
had one function which is to add and was used to aid his father counting tax as a tax collector.

Then German polymath [Gottfried Wilhelm Leibniz](https://en.wikipedia.org/wiki/Gottfried_Wilhelm_Leibniz) decided to level 
up that machine and created a mechanical calculator that can perform the basic arithmetics (addition, subtraction, multiplication, 
and division) which he called the *Step Reckenor*. Apparently, reckoner is a word related to calculation. The more you know. 🌈⭐

Not to undermine those previously mentioned events but this is where events are starting to be interesting, at least for me.

### The Jacquard's Loom
Let's skip until the early 18th century and talk about a particular device that unknowingly paved the way for the computers that 
we always see and interact everyday. And that is the [Jacquard's Loom](https://www.britannica.com/technology/Jacquard-loom).
This machine was supposedly created for creating fabric patterns and nothing much else for computing.

So, how does this machine was considered by most to be the precursor to modern computing and programming?

<img src="{{ '/assets/pictures/jacquard-card.png' | relative_url }}" alt="A Jacquard card." width="75%">
<p class="caption">A Jacquard card</p>

First, the machine uses wooden punched cards (pictured above) which can be considered as the descendants of the punched cards 
early computers usually use. These wooden cards then being read from the machine by a needle that will pass through the holes. If 
the machine detected a hole, the needle will pass through it. Else, it will not and continue on to the next one. Sooner or later, 
this became the basis for the binary system of which how early and modern classical computers base its operations.

Second, this machine demonstrates the concepts of a programmable machine and do its tasks automated through the wooden punched 
cards. It accepts an input through the punched cards, operates through a process, and gives an output which is the resulting 
knitted patterns and whatnot.

Lastly, this invention left such influence to [Charles Babbage](https://en.wikipedia.org/wiki/Charles_Babbage) that he planned 
to create one of the most famous icons in early computing, the *analytical engine*.

### Legacy of Charles Babbage
Before the iconic invention, he proposed plan of creating the difference engine, a calculating machine that is able to output 
logarithm tables. Then, he was able to have been officially backed by the government after seeing the 
importance of his invention and hoped it would fasten some calculations and correct several erroneous data of their navigation 
tables for their naval operations.

Unfortunately, as the construction process begins, it showed that building what supposed to be the first computing machine to 
input-output data is quite difficult. It continued until it became the most expensive government funded project and abandoned 
soon after.

Babbage was still determined and had another idea formed which is the famous analytical engine. This time, the said invention 
will be suited for a more broader purpose thus it will be programmable in nature. Fortunately, Babbage saw the potential in 
the punched cards from Jacquard's invention. He saw that the holes in the punched cards can be used to represent ideas and 
store data, containing references for future studies and an output for those data. With the potential he saw through it, he 
adapted the punched cards and planned for it to be as the input-output medium for his machine.  

Presumably as a reference to where the punched cards originated which is the weaving industry, he named the two main parts of 
the machine "store" and "mill". The "store" is where the data is stored and the "mill" is where the data is 'woven' or 
processed. In foresight, this two parts later developed into **memory unit** and the **central processing unit (CPU)** in 
the modern computing world.

During the development of his machine, he befriended [Ada Lovelace](https://en.wikipedia.org/wiki/Ada_Lovelace) and made her 
truly amazed to the capability of his invention to the point that she is probably the only one who saw what the machine 
can do beyond to what Babbage himself envisions the capability of his own machine. She noted that the machine can solve 
a large range of problems beyond computations and number-crunching through representing numbers as non-mathematical units 
(i.e. letter, color, musical note), as evidenced by her notes:
> [The Analytical Engine] might act upon other things besides number, were objects found whose mutual fundamental relations could be expressed by those of the abstract science of operations, and which should be also susceptible of adaptations to the action of the operating notation and mechanism of the engine...Supposing, for instance, that the fundamental relations of pitched sounds in the science of harmony and of musical composition were susceptible of such expression and adaptations, the engine might compose elaborate and scientific pieces of music of any degree of complexity or extent.

Furthermore, within those notes also contain a series of instructions for the unbuilt analytical engine to take in which will 
compute Bernoulli numbers. This particular part was considered by most to be the first computer program, although there's no 
programming language invented at the time. However, it cannot be denied that Lovelace's note contributed not only to the 
foundations of computer science but also to the advancement to the views of women in scientific fields.

Back to Babbage's analytical engine, like what happened with the first mentioned invention, its construction remained incomplete 
due to inadequate funding and personal conflicts. Sadly, the punched card as storage technology was not covered widely until later.

### Rise of the Computing Industry
As the population goes up, so does the data needed to be computed and automated. Herman Hollerith proposed a technology that 
can be used for computation which is now known as the *Hollerith desk*. These desks adapts Jacquard's punched cards as a form 
for data storage combined with the concept of representating data similar to what Babbage saw through the punched cards.

This invention was able to save the United States government $5 million USD by processing the census for 3 years as 
opposed to their predicted timeframe of 13 years for the census. 

This pretty much sets on how much the country in subject needs for computing and with the success Hollerith got from his 
invention, he founded the *Tabulating Machine Company* which later became *International Business Machines* (IBM).

IBM started to cater to those industries that needs heavy computing works such as accountancy as they saw the value of 
computing. Their devices were proved to be a success and later on, punched cards were used as primary form of data storage.

Later on until 1944, IBM and Harvard created the *Harvard Mk I*, the first programmable general-purpose computer but not fully an 
electronic one as it is mostly composed of switches, relays, and others that totals up to 750,000 components. This computer 
is the size of a large cabinet that has to be accomponied by a wide room. It also ran for 15 years.

One of the primary programmers of Mark I, Grace Hopper, found a literal bug on the computer which was a dead moth that is 
blocking the reading of data in the computer. From that point on, they refer erroneous part on the computation as a 
(computer) bug.

In 1953, Hopper was also the first one to invent a high-level language which enables programming to be a little more digestible. 
This was the "Flow-matic" which later became a basis for "COBOL". This in turn, also made Hopper to make the world's first 
compiler for her invented computer language since a high-level language needs to be converted into machine code.

As continuous demands for computing goes up, there's also the demands for keeping the computers to be effecient and faster in a 
long period of time since unlike in the modern era where in computers can calculate the four basic mathematical operations in less 
than a second, computers can take more than that to give those result. Multiplication might take 3 seconds and division usually 
takes more than 10 seconds to give the result.

To address these concerns, alternative solutions were proposed and basically serves as an upgrade to those components. One of 
the more featured inventions are the vacuum tubes which serves as a replacement to relays. With a faster rate of switching 
'on' and 'off' states which in turn with a better management of electricity flow, it was able to assist computers with a 
faster computation. It does have flaws like its fragility and burning out similar to light bulbs but it was a better solution 
than the previous way of managing electric flow which is a relay.

<img src="{{ '/assets/pictures/vacuum-tube.jpg' | relative_url }}" alt="A vacuum tube" width="50%">
<p class="caption">Sample of a vacuum tube</p>

One of the more iconic machines associated with vacuum tubes is the *Electronic Numerical Intergrator And Calculator*, also known 
by its shortened form as ENIAC. This machine was noted because of its speed and featured to be the world's first general-purpose 
programmable electronic computer. It could thousands of arithmetic operations and was estimated to have done calculations more 
than up to what the entire human race have done at the time.

History repeats itself as vacuum tube-based computers was reaching its limits so there was a huge need for a way to improve speed 
and reliability as well as cost and easier manufacturing. This is where transistors will enter and was able to garner huge 
improvement over the computing industry as it offers faster switching rates thus faster calculations and the potential to have 
concurrent operations.

Transistors also gave way to intergrated circuits (IC) which is just a small silicon plate that offers a new way to interconnect 
computer components. With the size and less cost of creating the chips, this helped manufacturing computers immensely and reaching 
a new level of accessibility as this eventually cause the computers to be affordable to the general public market.

Intel is considered as the first company to be able to compress an equivalent of a computer which was usually the size of 
a room into single chip. And then personal computers happened.

Then Apple and IBM decided to join into the wide opportunities flying over at the computing industry and created a line of 
personal computers. Next, Bill Gates who was a freshman at Harvard at the time decided to drop out to focus creating computer 
programs and manage his business which is Microsoft which made its way to be one of the largest technological empire in the modern 
world.

## Conclusion
And there you have it, the short(?) history of the computers. As most modern stuff, there is a story wrapped behind to the 
devices that we now always see and interact in almost every aspect. As a budding programmer, there is also something behind 
as to how computers usually represent data in a binary system, how does computers' speed measure things to be computed, and 
many more.

If you are not yet trying your hands on programming, I suggest you may as well start. It will help you understand the meaning 
behind of the things I've talked about and it brings you closer to the computer more than ever before (🧀). And if you want 
to start but don't know where to, you can check out my [resource list](http://localhost:4000/posts/freebies/free-resource-list) 
to view of handful of them (now THAT is a shameless plug).

## (Re)Sources:
- ~~['What's a Computer?' Commercial by *Apple* on *YouTube*](https://www.youtube.com/watch?v=sQB2NjhJHvY)~~
- [Computer History on *Computer Science Lab*](http://www.computersciencelab.com/ComputerHistory/HistoryPt2.htm) --- a rather detailed history on computers
- [Crash Course on Early Computing on *YouTube* by *Crash Course*](https://www.youtube.com/watch?v=O5nskjZ_GoI) --- recommended if you want a clearer history lesson than this; also it is a 2-parter with the history on early modern to modern computing as the next
- [Crash Course on Electronic Computing on *YouTube* by *Crash Course*](https://www.youtube.com/watch?v=LN0ucKNX0hc) --- the next part to the '*Crash Course on Early Computing*' video
- [CS50 2017 Week 0 Lecture on *CS50 (YouTube Link)*](https://www.youtube.com/watch?v=y62zj9ozPOM)
- [Pre-Programming: Everything you need to know before you code by *Evan Kimbrell* on *Udemy*](https://www.udemy.com/pre-programming-everything-you-need-to-know-before-you-code)
- [Primer on Computers on *Computer Hope*](https://www.computerhope.com/jargon/c/computer.htm)
- [When was the first computer invented? on *Computer Hope*](https://www.computerhope.com/issues/ch000984.htm)