Friday, January 19, 2018

Introduction To Computer Coding (Using JAVA Programming Language) PART 1


Welcome to this article which introduce computer coding (using java programming language).

The goal/aim of this article is to explain in details the fundamentals of Computer Coding to everyone (beginners/expertise), by using a popular and well recognized programming language (JAVA).

These articles are split into series (part). Part one which is this current article introduce us to the computer in relation to Software and Programming. The article will end with a little program in java instructing the computer to display a message after performing some task.

The computer we see today was not the computer that use to be. So when trying to look for a detailed definition of the computer one might get confused with the vast definition we see, and will most time end up not knowing which one to pick as the correct one.

Mainly people often define computer with reference to different perspective.

so one could say a: Computer is an electronic device that accept inputs as data, process those inputs into information using its central processing unit(CPU) and give out the information through its output device or store the information in one of it Storage device.

This definition tries as much as possible to define computer in terms of its various operations (Inputting, Processing, storing, Output).

This is just one perspective, let's look at another definition of computer.

According to Wikipedia: A computer is a device that can be instructed to carryout arbitrary sequence of arithmetic and logical operation automatically.

This definition shows another perspective; which is: defining the computer in terms of "what it can do"

From the last definition (Wikipedia's definition) we could see that the computer is a device that follows instructions in order to do what it is suppose do.

We should Note: something here. "The computer does not just follows any instruction, the instruction that the computer follows are either arithmetical or logical in nature (in the following series of this article we will be working with both kind of instructions). So, that is to say, majority of what the computer can do are based on sequences of arithmetically and logically arranged instructions".

The computer is a device that consist of large set of components (unit). Because of the large number of components that makes up the computer, there was a need to categorize those components.  So the computer is basically made up of two components which are: (1) Hardware (2) Software

Those Mechanical and Electronical components that we can see and feel are referred to as the "Hardware components" example of such component include: the monitor, the mouse, the keyboard etc.

But for this article we are not concern about the Computer Hardware components.

From the definition of computer given by Wikipedia we were able to see that the computer is a device that is given an instructions to follow (carryout).

These instructions that the computer follows are the Software Components of the computer. These instructions given to the computer most times are called "Computer Programs".

Most computer programs (if not all) are written instructions. These instructions are written using various languages (programming language) and other tools.

There are hundreds of computer language which can be used to instruct the computer on a particular task at hand. But for this article we will be dealing with a very popular and well recognize language (JAVA). At the end of the first part we should be instructing the computer to perform some simple task for us.

Like I mentioned earlier the goal of this article and subsequent once that I will write is to explain in details the fundamentals of computer coding.

We have seen for a fact that the computer receive instructions, and that this instructions received by the computer are written using various programming languages and other tools. These instructions are written by someone called a "Computer Programmer"; and the process of doing this is called "Computer Programming".

Well, technically speaking the process does not just involve writing instructions. There are more to the process than just writing the language.

Before a programmer begins to write instruction(s) for the computer to follow he/she has to design what he/she wants to accomplish in a pattern that the Computer CAN follow. Yes, the computer can be instructed to follow instruction(s) but we should note that the instruction we give to the computer should be formed in such a way that the computer can be able to follow it.

NOTE: One of the fundamental skills you need to learn for computer coding is for you to see a problem, figure out a solution for that problem and thereafter be able to translate that solution to sequential steps that a computer CAN follow in order to solve the problem.

After designing a solution to a problem in terms of sequence of instructions that the computer can follow then coding begins. That is, writing the sequence of instructions in a particular programming language. One thing we should note is that designing solutions to problems in a way that computer can follow is not an easy task. But there are series of approach that we can follow to get it done. I will be talking about some of these approaches in the consecutive series of these articles. And another thing that will certainly bring perfection is REGULAR PRACTICE.

A computer program is just a sequence of instructions that the computer CAN execute to perform some task. The computer does nothing more than follow instruction.

So as a programmer your task is to make this instructions to be simple and clear as possible. The reason is that you don't want to end up confusing the computer with the instructions you write. Yes some instructions can get the computer confused.

Just like the computer we used to know (first generation) is no longer the computer we see today (fourth/fifth generation). So are the programming languages we use in giving instructions to the computer.

Computer only response/follow/execute instructions in one particular language which is called "machine language"(low level language). This language is made up of binary digit which are 1s and 0s


Giving instructions to the computer in this format is very cumbersome. Due to this fact, developing computer programs was very difficult and time consuming at a certain time. But after a while other languages was developed to boost the efficiency of software development. This languages are generally referred to as “high level language”. This languages are English like languages cause they are constructed with English words like: “do, if, for, while, public, class, static, this” etc. and also consist of punctuation like { ;(semi colon) ,(coma) .(period) } etc.

There are a lot of high level programming languages, Java is an example of one of such high level languages. And it will be my approach of introducing you to computer coding.

High level languages like java are very easy to write and learn (at least compared to machine language) when trying to give instructions to the computer. Unfortunately the computer cannot understand high level language. The computer can only understand and execute machine language.

Luckily for us there are Software called Language Translator that will come handy in regard to this issue.

One of such software is called Compile: A compiler is a software (language translator) that translate/convert a High Level Language in English like statement such as Java to a low level language (machine language in 1s and 0s).
So basically what we will do, is that, we will write instructions in a high level language like Java feed that instructions to a compiler, the compiler then turns the instructions into a machine code (1s and 0s) for the computer to execute.

Enough theory let's take a look at how these instructions actually look like. Note that details explanation of the following code sample will be given in the next Series.
You should not try too hard to understand it yet, this is just to give an insight of the Kind of arbitrary instructions that are given to the computer.


Post a Comment