How to be a Programmer | Part 1: Introduction

CtechF - How to be a Programmer | Part 1 : Introduction

How to be a Programmer (Part 1) – Introduction and Evolution of Programming language’s


Programming is a creative task where a computer programmer provides instructions to the computer on how to perform a particular task.A program can be defined as a set of instructions which instructs the computer which task should be carried out to find a solution to a certain problem.A computer cannot understand the words spoken by humans, and this necessitates the need for artificial languages, which can instruct machines to carry out computations we desire.  A programming language can be considered as a tool which can be used in problem-solving.


1) Evolution of programming language’s

FORTRAN  (FORmular TRANslation System) is a World first programming language. It designed by John Backus and IBM. It’s Still used in 2019. It designed for science and engineering.

CtechF (How to be a Programmer) - Programing Languages

1.1) First generation programming language (1GL).

This is a language which can be directly understood by the computer. Binary numbers such as 0s and 1s (bits) are used to provide instructions. Hence the processor could directly run a program written in a machine language.

  • Depend on the machine type. (a program written to one computer may not run on another computer)
  • No need for language translating programs to translate the program into binary
  • Program processing speed is fast.
  • A programmer should have knowledge of Computer hardware.
  • Ability to debug programs more difficulty than the other generations.
  • Too many instructions. Programs coding are extremely difficult.
  • Could be executed directly on the machine

1.2) Second generation programming language (2GL)

Instead of commands written in a machine language using 0 and 1, 2GL languages (assembly language) is designed to use simple symbols.

  • Fewer instructions that are represented by symbolic names such as ADD, SUB.
  • The operation is comparatively slower than the machine language.
  • Depend on the machine type.
  • A special translator called “Assembler” is used to convert the symbol into 0s and 1s.
  • Ability to the debug programs (debugging) more easily than the programs in 1 Generation Languages.
  • The programmer should have knowledge about Computer hardware.
  • The use of the symbol makes it simpler to understand.
CtechF (How to be a Programmer) - 2GL - Assembly Languages

1.3) Third generation programming language (3GL)

  • Program writing is easy because of the vocabulary, which is easy for programming. Based on languages closer to humans. (English)
  • Does not depend on the machine. It is machine independent.
  • It can be called a procedural language. Ex: Fortran, Algol, Cobol
  • Need to be translated to machine language instructions before executing on a computer
  • Error diagnostic messages are given and easy to debug.
  • Training a programmer is easy.
  • The operation is comparatively slower than the 2nd Generation languages.

Example of 3rd Generation Languages

MS Visual Basic, C, C++, C#, Java, Ruby, Python, Ada… etc.


1.4) Fourth generation programming language (4GL)

  • Used to program a computer to make decisions in real life situations. Used to build expert systems. Closer to human languages such as English.
  • Not depend on the machine.
  • Computers Understand natural human languages using these programming languages easily.
  • Ability to learn the language within a short time of period.
  • Ability to accomplish a task by using a smaller number of commands relative to the other types of language.

Example of 4th Generation Languages

LISP, Prolog, MATLAB, AVS, SQL, WAVE, GAUSS, Iris, APE

Notice:

Machine language and Assembly language are considered low–level programming languages. (1st and 2nd Generations)

Languages like PASCAL, Prolog, Python, C++, C#, Java, Ruby,  and JAVA are examples of high–level programming languages. (2nd and 4th Generations)

2) What is Paradigms?

There are many different approaches to computer programming. These are called programming paradigms. Different approaches develop solutions to problems using programs using different paradigms.

Even though most of the programming languages come under one paradigm type, certain languages show elements related to different paradigms.

CtechF (How to be a Programmer) - Programming Paradigms

There are a number of programming languages. There are differences among different programming language types.


2.1) Procedural paradigm

A procedural is a computer programming language which consists of a well-structured set of steps and procedures. This includes statements for problem-solving steps.

Example:

CtechF (How to be a Programmer) - Procedural Programming

Procedural Paradigm – Saying how you archive it

CtechF (How to be a Programmer) - Programs Types

Keep block A

Keep block B on top of block A

Keep block C on top of block B


2.2) Declarative paradigm

A declarative paradigm develops a structure and elements of a computer program by indicating calculations and/or logic without a control flow. This helps to reduce or eliminate side effects.

In declarative programming, the program is designed to solve problems explaining what you want rather than stating how to the problem as in primary programming languages. The program itself does not explain how it is executed.

This means the computer is provided only what the problem and the required solutions are, not how to solve it. The computer finds solutions related to the given problem.

This is completely different from procedural paradigms which execute an algorithm as explanatory steps. Declarative paradigms related to Artificial Intelligence.

Example:

Declarative Paradigm – Saying what you want

A pillar which consists of 3 blocks

CtechF (How to be a Programmer) - Programs Types

Example of Declarative languages

Prolog, Haskell, Miranda, APL, XML, SQL, HTML, LISP


2.3) Structured paradigm

A structured program is a logic-based paradigm and it is the pre-discussed object-oriented program.

A structured paradigm provides facilities to understand and modify the program. The system is decided into subsystems and there is a top-down flow in it.

CtechF (How to be a Programmer) - Structured Program

Example of Structured languages

PHP, Algol, C++, Java, C#, Perl, Ruby


2.4) Object-oriented paradigm (OOP)

CtechF (How to be a Programmer) - Object Oriented Chart

Methods are codes that are in the form of procedures that handle data. These data structures exist in the form of fields which are called Attributes. The class is the basic structure of object-oriented programming. The class describes the behaviors of data and instances. The class can create an object of the same type.

CtechF (How to be a Programmer) - Object Oriented

An object-oriented program consists of many objects interacting with each other by sending messages

Example of Object oriented languages

Smalltalk, Java, C++, Python, Ruby, Objective C

3) Programming and Scripting

Usually, there are hard and fast syntax rules in programming languages. These should often be compiled. Programming languages need to be compiled. Further, scripting languages should be interpreted. Both JavaScript and PHP are scripting languages.


Sources:

Liked it? Take a second to support CtechF on Patreon!

Leave a Reply

97 Shares
Share
Tweet
Share
Pin
Share