Introduction to programming for beginners

Introduction to Programming For Beginners.

When I first started learning how to program on my own, I was overwhelmed with all of the info on the web and in books. I found that there were a lot of basic questions that I couldn’t find the answers for, and I still see these questions asked by other beginners today. Today, I answer those questions.

This tutorial is part of a series. To see the next tutorial click this link: Install Python

There are a lot of explanations, and resources that I wish I knew about back then that I now know today. So I plan on providing those ideas, resources and anything else that’s helpful to beginners. I hope I can make your life as a new programmer a little easier than mine was.

I call this an introduction to programming for beginners, but we’re not going to be doing any coding or programming here. That will come later. Today we’re just going to get familiar with the idea of programming.

Intro

This is the first entry into a series of articles that will be a guide for aspiring programmers. Today we’ll look at what a program is, and learn a bit of history. But first…

I want to start by creating a context for this guide. There is a certain mindset that one has to have while learning something as vast, and challenging as programming. Very early in your quest for knowledge you will fall into a never ending rabbit hole of information, terms, concepts and phrases that you’ve never ever heard of, no matter how nerdy or geeky you thought you were before.

One thing to kind of keep in the back of your head is that when you turn on a computer to start programming, a lot of work has been laid down before you. Computers have come a long way, and as a total noob, it’s difficult for experts to explain to you exactly how it all works.

Most beginners expect to start at some “beginning” but in truth there is no “beginning” now days. We sort of have to just be thrown somewhere in the middle of it all and work our way out from there.

When I first started learning, I would be reading a tutorial, a guide, some documentation, or whatever. Not even two sentences in I’d see a word that made no sense, so I would look it up. But every time I looked up a new word or term, the definition would have like 10 to 20 more new words that I had never seen before. Even more daunting, the definitions for those words, would have another 10 or so words that I had no clue about! So, so discouraging :(

I’m going to make the explanations in this guide as simple as possible so that beginners don’t get overwhelmed with terminology that they may not be familiar with. With that in mind though, I want to share the strategy I used to deal with the large amount of information I was pelted with as a beginner myself.

A stick figure being pelted by information.
Getting pelted by information.

Side Note: I realize that it looks like my 2 year old son drew the above picture… but it was me.

One thing you’ll have to get used to doing, is just skipping over stuff you don’t understand. In the beginning you’re going to come across a lot of articles and videos that include words which will probably make very little sense to you. But the main idea in the early stages is to just get yourself familiar with the “lingo”.

The more you read the more you’ll see some common phrases or words. When you feel like there is a word you keep seeing over and over again, take the time to look it up. But don’t go looking up every single new concept or word in every article you read. Take your time. If you can help it, limit yourself to learning one or two new things a day. It really does add up.

Sometimes you have to kind of let your mind go blank as you read. Just look for the 10% that makes sense to you, and over time you’ll start to realize that more and more comes into clarity. Before you know it you’ll be reading about programming related stuff with ease, and you’ll see that you get tripped up by cryptic phrases much less often.

Now, let’s get on to answering one of the most basic questions.

 

What is a program?

“What is a program”. This is one of the first questions most beginners have, and it was definitely one I had. The thing is, that this is a question that gets asked by absolute beginners, who don’t really understand how to word the question properly, to get the answer they want.

You don’t know what you don’t know, as they say.

To get started, here’s a couple definitions from the web:

In computing, a program is a specific set of ordered operations for a computer to perform. – searchsoftwarequality.techtarget.com

 A set of coded instructions that a computer can understand to solve a problem or produce a desired result.
– businessdictionary.com

It’s often said that a program is like a recipe, or a set of instructions – like the kind that’s included with a shelf or table from IKEA.

These definitions and explanations are OK, but this wasn’t what I was trying to understand when I first started learning, and I’m guessing it’s not what you’re trying to understand either. We’ll come back to the definitions later.

In my experience from answering questions in forums, and other places on the internet, is that most people asking this question are really trying to understand how a computer works and what makes them run in the first place.

Many tutorials will get you writing your first codes into a simple text editor like Notepad (Windows), TextEdit (Mac) or perhaps more advanced editors like Sublime or Eclipse. But how were these programs programmed?

This is what tripped me up when I first started. When I set out to teach myself how to program, I wanted to understand what made the program I was programming with in the first place. How does it all work? Where does it all start?

A little history.

Let’s take a step back and look at what a computer is, and how they used to be programmed in the days of yore. Computers used to be very different from what we know of today, and the way they were programmed was possibly even more so. By understanding a bit of background, we’ll better understand what a program really is.

I’m going to butcher the history of computing a little bit to keep this brief, and not too confusing. I’m going to spare as many dates and names as possible, but I’ll include a few links to some great resources for those interested in learning the history in excruciating detail.

One of the first machines that could be programmed was invented by the Frenchman Joseph Marie Jacquard in 1801 (didn’t I just say no names and dates?). Jacquard made a loom that could be programmed with wooden punch cards. The loom could weave fabric into extremely complicated patterns, even as complicated as a portrait of Jacquard himself!

It might make more sense if you just watch this 2 minute video.

This might give you some more insight to what a program actually is. In essence, when we make a program, we are making it for a machine that has been designed to do something with it. So in the case of Jacquard’s loom, a program was a series of punched wooden cards. The loom was designed and built to run differently depending on the pattern of the holes in each card.

I feel like if I remind you that I’m going to butcher history, it makes it more acceptable to do so – especially if I leave links at the bottom right?

Anyways… later on in the 1800’s there would be many concepts of machines that could not only be programmed to make fancy carpets, but also to make complex calculations for the British navy. Importantly a man named Charles Babbage theorized and designed a mechanical machine, called the Analytical Engine, that could be programmed conditionally. Meaning that a program could produce different results each time it’s run, as apposed to Jacquard’s machine which, for all practicality, produced the exact same results every time.

This idea of programming machines conditionally prevailed into our modern idea of computers today. However there are still a lot of advancements to be made to get to were we are now.

A hammer was once a rock in a person’s hand, but that hammer helped someone build another tool, that made it possible to make a better hammer.

One, two, skip a few… it’s the early 40’s and 50’s and computers are now fully realized as we know them today (although much bigger, and way less capable). They’re made with complicated electrical circuits, large switches and relays. They’re clunky, expensive and by today’s standards extremely slow and impossible to use by most people.

These computers were programmed by physically rewiring components, and setting switches and dials to different positions.

Pictured here, with AVIDAC, is pioneer Argonne computer scientist Jean F. Hall.
A program for these computers was literally a set of instructions written on a piece of paper. The instructions told the operator of the computer, which wires went where, and what the position of the switches and dials had to be set to in order to achieve the desired calculation. Preparation for these calculations could take days and even weeks!

Output during these times wasn’t on computer screens like we have today. It would have been punch cards, lights, and sometimes teletypes which were basically old-school printers, which would print the computer’s output onto paper.

As computers became ever more popular there were more and more super smart people who really loved playing with them. Despite this love, they didn’t like programming them.

Easier ways of programming were invented and computers could be programmed without rewiring. The “language” used to program these computers became binary, because computers were being programmed with switches that could either be in an “off” position, or an “on” position. Hence the term binary, meaning composed of two parts. When writing a program the positions of the switches were represented by 1’s and 0’s, again, this was all done on paper.

To be candid, this method still sucked.

So somebody by the name of Grace Hopper came up with, and implemented the idea of a program, that could translate other programs. This meant that commonly used codes could be turned into simpler codes that were much shorter. The program was called a compiler.

The compiler could be loaded into the computer, and then would translate the special codes in a program into the 1’s and 0’s the computer could understand. The codes used to write the programs that were translated by the compiler was called an assembly language.

Keeping to my word, I will continue to  consistently and crudely sum up a plethora of advancements. Computers became able to be automatically programmed. Meaning you no longer had to physically flip switches to code 1’s and 0’s. Instead programs were fed into computers on paper tapes, punch cards, and later keyboards.

Assembly languages offered a way of creating much more complicated programs that would otherwise be too difficult to write in regular binary (1’s and 0’s). But assembly code was still fairly limited and difficult to write, so assembly languages were used to design other programming languages that closely resembled English. They used words like “IF” “FOR” “GOTO” and “WHILE”.

These languages evolved into what’s known as “high-level languages” and many of them are either still popular today, or have had huge influences on the currently popular languages like C#, Java, Python, VB etc.

Connect the dots.

So to give you a conceptual idea of all of this, think of how we use tools today to build things like houses and cars. Those tools are made from tools that had to have been made from simpler tools before hand.

A hammer was once a rock in a person’s hand, but that hammer helped someone build another tool that made it possible to make a better hammer. You see where I’m going with this?

When we write programs today, they are written in what’s called source code. The source code gets translated by another program called a compiler, and is turned into 1’s and 0’s that your computer can understand.

At the most basic level, your computer is just like Jacquard’s loom in 1801. It is a machine that has been designed to understand a certain set of instructions. It just happens to be much more advanced, and has been physically assembled and “wired” to understand patterns of electrical signals in the form of 1’s and 0’s (“on” and “off” ) as instructions.

A program made of these 1’s and 0’s was made to translate another more human like set of instructions. That human readable set of instructions is called a programming language, and we use it to create programs called operating systems like Windows, Mac, and Linux. Those programs are used to help us make other programming languages, which helps us make other programs. Those programs sometimes are made to run other programs, and you end up with a long chain of events where programs are running inside of programs inside programs to make programs…

So going back to those definitions, they basically state that a program is a set of instructions intended to be performed or executed by a machine. And that is exactly right, only now you have some context behind those definitions, and can hopefully conceptualize the idea of a program in your head.


 

I realize that even after all of that, there may still be many questions. I skipped a lot of facts and missed many important technologies in my short trip through history.

For many beginner questions, the answers can be found in learning about the history of computers. I strongly suggest going far beyond the brief history presented in this article if you’re really interested in becoming a programmer or anything related to computing technologies.

I’ll list a few resources below.

I really hope you enjoyed this little introduction to programming for beginners!

Cheers,

Dan

Further Reading.

A fairly comprehensive history of software: http://www.thocp.net/software/software_reference/introduction_to_software_history.htm

The history of computers in nice bite sized snippets:  http://www.computersciencelab.com/ComputerHistory/History.htm

Who doesn’t like timelines?? http://www.computerhistory.org/timeline/?category=cmptr

The oldest computer known in existence dates back to 12,000 B.C.E.  http://www.techtimes.com/articles/21173/20141129/worlds-oldest-computer-antikythera-mechanism-more-ancient-previously-thought.htm

What to watch.

Here is a really awesome demonstration of Charles Babbage’s Difference Engine (the machine he designed before realizing the Analytical Engine).

2 thoughts on “Introduction to Programming For Beginners.”

Leave a Reply