Login
Password

Forgot your password?

Learn How to Program a Computer

By Edited Jun 27, 2016 0 0

Obviously, computers are everywhere in the world and are a permanant fixture in society. They give us opportunities to play, learn, socialize and so much more. The bulk of the applications that run on computers are extremely complex that required teams of developers years to perfect. Due to the complexity, there will always be errors in the applications. This is unfortunate, but understandable. Computer applications are written in development languages by programmers. As with any human activity, errors can be made by the people involved. Many times the errors are minor, of course. Perhaps a screen title is misspelled. Other times, an error can cause an application to fail. These are consequences of development that application designers and programmers seek to avoid.

Despite the fact that applications are often large and complex, there are still many reasons why people should learn how to program a computer. Young people, especially, will gain important skills that will help them in their future careers. All computers users, though, will gain an understanding of the internal workings of computers when they learn basic programming skills. By programming, computer users learn why applications work the way they do and what can be done to fix
them. It isn't easy to write large applications, so the beginner should start small.

Hello World Program
The most elementary program in the world is known as "Hello World". This is a standard starting point for beginners in most every computer language. The basic concept is that someone new to a language should get it to do something. "Hello World" just prints out the words "Hello" and "World". Before this can occur, however, the programmer, or some other computer specialist, must set up a development environment for the new programming language. Depending on the language, this may be simple or hard. Certain languages require extremely complex server infrastructures while other languages are as simple to use as any trivial web page. By setting up the environment and creating "Hello World", you get to do something which is verifiable.

What is a Programming Language?
A programming language is a method that people use to tell computers what to do. Computers will only do what they are told by a computer program. When a computer starts up, it is capable of doing only one thing: it goes to a spot in memory to find the first instruction that it should follow. That instruction will then tell the computer what to do next.

Perhaps you have heard that computers are digital. What does that mean? It means that the basic core of all computers operates on numbers only. Each number can correspond to something. People are used to this in math. 3.1415 is a number which represents pi. The difference is that computers can use the same number to represent many different things, depending on what people need. Remember that at the core of the computer, everything is a number. The first number is represents an instruction that the computer can perform. Here is an example of a core computer program:

8905 03F3 1B22 0CC0 0000 1021 92CA FFFF 9F90 CCCA 0001

A computer might process the above and perform some work. In the beginning of computing, programmers had to memorize numbers like the above. Soon computer manufacturers used some of the numbers to represent what instructions the computer could perform. A number like "89" might be an instruction telling the computer to add two numbers together. For example:

89 05 03 - ADD 05, 03

The computer reads the number 89. It decodes this as an instruction to add the next two numbers together. It reads in 5 and 3, adds them together for a total of 8. It is up to the programmer to tell the computer what to do next. Maybe the 8 should be printed to a screen. Maybe it should be stored on a disk. The computer will read the next numbers in sequence to find out what to do next. If the programmer never tells the computer to do anything with the 8, then nothing will happen. The computer cannot determine what to do, it must be told by a computer program.

With the representation of computer instructions by numbers, programming became easier. For example, a short program could now be read by other programmers:

ADD 05, 03 ; Add 05 + 03
MOVE ACC, 239F ; Move the sum into memory at location 239F, saving it for future use
MOVE AX, ACC ; Move the number at location AX to location ACC
DEC ACC ; Subtract 1 from the number at location ACC
JNZ 8CC3 ; If the last instruction had a result of zero,
; go to location 8CC3 for the next instruction

This program is easier to read than the equivalent core numbers, but there can still be errors. What if the first line was supposed to be "ADD 05, 04"? There is now a subtle error in the program. What happens next could be anything. Hopefully the programmer or a reviewer will find an error like this before the program is released. Unfortunately, many errors similar to this are missed all the time. These are called "bugs" in the program.

In order to make this type of programming easier, languages were developed that were much more like english. Simple words like "if", "else" and "while" became computer instructions that people could understand. Programs like the one above could be made quite legible and, (more importantly), understandable. Using a new language, the same program could now look like this:
Money = 5 + 3
Balance = Balance - 1
if Balance = 0 :
request_funds()

This program is much easier to read than a numeric program. The programmer has chosen to use words like "Money" and "Balance" to represent stored quantities, called variables. This is solely for the benefit of human readers. The computer doesn't care if a value in a program is called "money", "m", "m1" or anything else. In the early days of computer programming, variables were required to be single letter names. That is no longer a restriction for modern languages.

What Should You Learn?
A great language to learn is called "Python". This is a free language that is easy to learn, is similar to many other languages, has a large development community that will help you and it is widely available on most any type of computer. It is certainly not the only language you should consider. If you have access to another language and you have people to support your learning, you should seriously consider that as your first language. If not, Python is at least as good as any.

Python Programming Language
Python is a very powerful programming language that is easy to read, understand and it is fast. It is a free product that lets you write applications requiring no license payments. Python is easy to learn and has a very established community base of people that are happy to help new programmers get started. With Python, a program can be written to be very easy to understand. It is also possible to write very powerful programs. Beginners can get something running fast, ("Hello world"), and then build their knowledge by writing more programs. When the concepts are understood, the new programmer can design a larger program that will do more complex tasks, starting with programming basics.

Advertisement
Advertisement

Comments

Add a new comment - No HTML
You must be logged in and verified to post a comment. Please log in or sign up to comment.

Explore InfoBarrel

Auto Business & Money Entertainment Environment Health History Home & Garden InfoBarrel University Lifestyle Sports Technology Travel & Places
© Copyright 2008 - 2016 by Hinzie Media Inc. Terms of Service Privacy Policy XML Sitemap

Follow IB Technology