Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 3.93 KB

01_WhatIsComputerProgramming.md

File metadata and controls

48 lines (37 loc) · 3.93 KB

What is Computer Programming


Computer Programming is the art and science of creating logically organized sets of instructions intended to be executed by a computer.

As computers are present in almost all aspects of our lives these days, we notice how important and cool programs are. Programs are used everywhere: in controlling robots, in cars, spaceships, patient care, phones, video games, web sites, TVs, movie making, you name it.

You may think these things are all so complicated and you may have become frustrated trying to learn programming on your own. Many computer program applications are indeed very complicated and may consist of thousands, sometimes millions of lines of code and dozens of different technologies, but they all boil down to a very limited and small amount of computer instructions. Billions and billions of these small and simple instructions, organized in a very structured and logical way. The secret of building these very cool and complicated applications is that the programs are created from very simple things, organized in blocks, and then assembled together.

Actually, in theory, any program can be reduced to only five things: two types of data: "ones" and "zeros", and three forms to combine them: "or's", "and's", and "not's". Of course nobody creates programs using these five elements only, because one would have to write many, many, many instructions to do very basic things. Instead we use programming languages, that are translated into machine language programs that one specific type of computer can understand and execute. How are these translations done? Using computer programs, of course.

Programming languages have a few commands, usually in English, and a logical way to assemble those commands together, some rules about how the program can be written, or a grammar if you prefer. You can write any book using English words and the English grammar. In the same way you can create any program using a certain programming language words and grammar.

Many popular programming languages share very similar commands and grammar. Especially if they have a common evolutionary ancestor. For example: C++, C#, java, and javascript use the exact same "for" command, because they are all descendants of the language C. Actually there are a very small set of commands categories, and once you get used to one language, learning a different one is somewhat easy.

It is more important to understand how to create programs in a generic way, how to describe the program logic, than knowing the details of a specific language. In this course we will focus primarily on programming logic, that we will describe using "pseudocode". Pseudocode is an informal high-level description of a computer program or "algorithm", and an algorithm is a specification on how to solve a problem. You have been presented to many algorithms in pseudocode before. A cooking recipe is, in a certain way, the pseudocode for an algorithm. As are the instructions to assemble a certain piece of furniture, or the manual instructions on how to use your washer machine.

So every problem we will solve, every algorithm we will create, will start with the pseudocode, and then we will transform it in a computer program in a certain language.

Now it is your turn to practice. Assume you will write instructions to someone. Assume also this person have the necessary ingredients and tools available. Write precise, ordered, and numbered unambiguous instructions to:

  1. prepare a PB and J sandwich.
  2. prepare a jar of coffee.
  3. place an international phone call using a mobile phone.

Back to course outline

Previous Page

Next Page