Login
Password

Forgot your password?

Learning To Program A Computer - Focus On Algorithms Not Language Specifics

By Edited Jun 16, 2016 0 0

Modern computer languages are based on the English language. Many of them share the same basic commands such as "IF", "FOR", "WHILE" and other simple words. These instruct the computer to do something that is related to the meaning of the word, in English. Those speakers of other languages are basically forced to translate their own language into these words as every computer programming language, (with perhaps 3 exceptions), is based in English. There are many computer languages that someone might consider learning. Some like Python or PHP are completely free to use. Others, like "C" or FORTRAN, are available commercially for various costs. A good choice is one that is used at your place of work or one that is used by an expert that you may know. Many people purchase their computer development environment to support future career options. Simple programming is also a great skill to teach children. Regardless of the reason to learn how to program, and the language to learn, there is a benefit to learning about computer algorithms. An algorithm is a high level document that outlines what a computer program is going to do. The algorithm is closely related to other planning tools such as system diagrams and project plans.

Algorithm Basics
An algorithm for a computer program should start by defining how a computer program will work. There should be no attention paid to the syntax of any computer language. Some people describe the algorithm building technique as writing in "psuedo-code". Psuedo-code is a fabricated set of statements, based in English, that can easily be translated into any available computer language. As mentioned, the underlying language is English. This can present some difficulties for foreign language speakers, which can be eased by algorithms. A requirement, in English psuedo-code such as "While the count is less than 10", will be developed in Spanish as "Mientras que el número es menor de 10". When appropriate, the Spanish pseudo-code can be translated into the appropriate computer language steps, in English. Consider the following algorithm, specified in psuedo-code for a simple computer program:

Get User Comments
-----------------
Get input from the user
Build a text email
Send the email to the web site administrator

This is a simple declaration of a piece of code that can be written in a computer language. Each of the steps is something that a computer could be expected to do. The algorithm can be written quickly in such high level terms. More importantly, it can be extended and improved easily as well. Here is the same example with some enhancements:

Get User Comments
-----------------
Get input from the user
Get the user's name
Get the subject of the user's comment
Get 5 lines of comment text
Build a text email
Address the email to operator@outsite.com
Use the subject "COMMENT" + the user's subject
Send the user's comments as the email body
Send the email to the web site administrator

Improving Algorithms
With an overview algorithm, the computer program design can be reviewed. Each of the statements in the algorithm represent something for the computer to do. As they are enhanced, the algorithm psuedo-code will become easier to translate directly into a real computer language. When the development has been completed, comparison of the results can be made with the original algorithm. Many organizations use algorithms as the basis of both their testing specifications and computer system documentation.

Algorithms and diagrams
A diagram showing the basics overview of a computer application, can be similar to an algorithm. In fact, many system designs use diagrams exclusively. These graphically show exactly what the computer system has to do, just like an algorithm. Diagrams use very simple shapes to represent users, systems and processes. There are many kinds of diagrams that are used by computer programmers. The simplest one that is related to algorithms is the "Use Case Diagram". Here is a use case that corresponds to the "Get User Comments" algorithm:

Use Case Diagram


This diagram describes all of the abilities of the computer system in extremely simple terms. Many people find diagrams easy to draw and describe to any level of person, from entry staff to executives. The use case diagram has actually been extremely popular since it's introduction just 12 years ago. Many previous algorithm building techniques have been practically swept aside by the use case diagram. As evidenced in the diagram, complicated steps can be simplistically described from the point of view of anyone involved in the steps. Further algorithms or diagrams can be developed over time that clarify and detail each of the required steps.

Algorithms, Diagrams and Students
The value of algorithms and diagrams for students of computer programmer is just how easy they are to create. While complicated systems can benefit from them, a trivial student exercise can have an algorithm which keeps the student focused on the learning task. The student describes the steps in the algorithm. Each of the steps represents a process that must be developed. Each of these is simple, perhaps, but beyond the ability of the student. This allows the student to advance the whole project a step at a time. For example, "Record Comments", is a step that must be accomplished. There is no indication of how this has to be done. Since the student is learning about programming, however, we can assume that certain computer programming steps are involved. There is also no indication of which programming language is to be used. The student will build the programming code in the language of their choice. Armed with the requirements of the step, the student will proceed to learn exactly which options are available in their programming language that help the program "Record Comments". Perhaps further algorithms or diagrams are required for this step. The student can build finer algorithms and diagrams to describe the intricate details of the "Record Comments" step. While this is likely not necessary for a simplistic exercise like this one, it is exactly how larger systems are built.

Using algorithms and diagrams as organizational aids, computer programming students can start with easy descriptions of their systems. As they refine the involved steps, they can improve the algorithm to reflect additional knowledge that they gain about the steps. In time, the algorithm is sufficiently detailed to allow the student to translate the steps from an English-like psuedo-code to the exact syntax expected by the computer programming language. Students will find that their algorithms will be quite finely detailed during the beginning of their language training. In time, as they become proficient, algorithm steps can obscure more complicated steps. The student will be able to translate these into the computer language easily as they will be similar to previously accomplished steps. By concentrating on algorithms and diagrams, the student reduces their dependence on a particular computer language. This reduces the risk that a computer language will become less relevant or that a new, better language will become popular. Algorithms and diagrams can easily be translated into new computer languages whereas installed programs cannot.
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