Computer Programming Basics

Whatever programming language you want to learn, you need to first be acquainted with the computer programming basics. Right from smallest details, like putting in comments to designing your computer programs such that they can be reused, are all parts of the basics of computer programming. Here, in this article, I will try to put in front of you some of the computer programming basics.
Computer Programming Basics
Before starting off with the computer programming basics, let us try to understand the basic concepts regarding a computer. No doubt, it is always better to take some computer classes or take up some computer courses, for learning computer programming basics. But this article is meant to give you an introduction to programming. A computer program is nothing but a set of instructions, which when executed give result to a certain operation. These instructions need to be written logically. What I mean to say, is that the instructions should be in a flow, and before writing the program you need to decide the flow of the program. Remember, the computer is a very intelligent machine, but it can do only what you ask it to do. So, the program that you are writing can only work wrong, if there is something wrong in the set of instructions, that you have written in the computer program. The problem with computer programs lies with the manual errors. So one of the most important computer programming basics is, that the set of instructions should be logical.

Before going into further details, let us try to understand the different types of programming languages or rather the different levels of programming languages.

Machine Level Language
Computer works in bits and bytes. It understands the language of the binary digits, 0 and 1. You may write a program in whichever language you want, but it is finally converted into the language of 0s and 1s before it gets executed. Writing a program in machine language is definitely very difficult. It is not possible to memorize a long string of 0s and 1s for every instruction that you want to get executed. It is true that before the higher levels of programming languages were designed, machine languages were used for writing programming codes, but they are no longer used for designing computer programs.

Assembly Level Language
An assembly level language is just one level above the low level machine languages. No doubt, designing a program in assembly language is also not a very simple task, but still the programming code is quite understandable. A person with a good hand in assembly level language can very easily understand the statements. Till date, many of the programs for embedded technology are designed in assembly language. A computer program like the assembler is used for converting the assembly level programs into their corresponding machine level programs.

High Level Language
High level languages are far more simpler to understand for the humans, than the assembly level language or machine level language. There are clear statements for writing, each and every instruction. However, whatever language you learn, you need to have a proper understanding of the basics of that computer language. Without knowing the basics of a particular language, you cannot write a program in that language. The languages in these categories have different purposes. Some are meant for web programming, some are meant to design simple desktop applications, while some can do both. But, one thing that you need to understand is that, high level language is not at all understandable for the computer. For the purpose of understanding a computer program written in a high level language, it uses a compiler or interpreter to convert the programming code into its equivalent machine language form.

Besides, these three basic types of languages, there is a next generation of programming language being developed, which is referred to as the fourth generation language. Fourth generation language are being designed with the perspective, that a person with little or no programming experience can also use these languages to prepare his own code. No doubt, even the high level languages like Java, have incorporated such systems, so that the person writing the programming code does not have to memorize each and every function.

Now let us try to understand some of the other computer programming basics. What I intend to tell you is the basic methodology that you should follow, irrespective of the fact, which high level computer language you are using. Some of the basic factors that you need to take care of when writing a computer program have been mentioned below.

Logic of the Computer Program
This is the backbone of your computer program. You need to prepare the logic of your computer program depending on all the resources that the programming language allows you, before starting off with the actual coding process. Even better, prepare a flow chart for the computer program or write the algorithm, before you start off with writing the computer program.

Divide your Programs into Functions
Almost all computer programs allow you to write the programs such that the programs are divided into functions. You need to design the functions such that they are written in the minimum number of instructions and can be reused again and again.

Syntax of the Command
Learn the syntax of each command that you will be using. Improper use of syntax is the major reason behind most of the computer programming flaws. Many programs like the new versions of Java, have features like Java doc, which you can use to check out the syntax of any command or inbuilt function that you want to use.

Shorten your Code
This is very important. Lesser the number of instructions, faster will be its rate of execution. Many a times, we use a very complicated logic to get a task done, which can be performed easily by using one of the programming language's inbuilt functions. But it happens so that many a times we are not aware that these functions exist. To get rid of such problems, try to have a fair knowledge and idea of all the inbuilt functions that are available in your computer program.

Names of Variables and Functions
The variable names and functions should be logical. The process of coding becomes simpler, if you use proper names for the variables and functions that you use in your programming code. Using absurd variable names, won't hamper the functionality of your program, but when you try to modify or enhance the same code later, you may find it difficult.

Comments
Many of us don't take any stress on this part. Do put in comments, against each execution part. Comments are statements that are not executed but are quite useful when modifying the code or during error correction. With proper use of comments, you can easily extend your program, whenever you want.

There is even more that can be added to the computer programming basics. There are some of the basics of computer programming, which you can yourself make out, when you start computer programming in a particular language. What I have mentioned above, are the most obvious computer programming information and basics that you need to learn, if you are looking forward to a computer programming career.

By Shah Newaz Alam
Published: 9/5/2009
 
Use the feedback form below to submit your comments.
Your Comments:
Your Name:
Use the form below to email this article to your friends.
Recipient Email Address:
 Separate multiple email addresses by ;
Your Name:
Your Email Address: