Skip to main content

Computer Programming and Programming Paradigms.

"Computer programming has an integral role in our world. Without computer programming no one would be able to use cell phones, computers or smart TV. Learning  programming can help to innovate and create solutions for a global society."



What is a computer program?


  • Computer program is an ordered and detailed collection of instructions that are carried out by a computer to perform specific operations.

What is programming? 


  • Programming is implementation of logic to facilitate specified computer operators and functionality. It can occur in one or more programming languages which differ by application and model.


What are the basic functions of a computer program?


  • There are 3 main tasks that are done by a computer program.


  • Manipulate Data.

  • Perform Operations.

  • Provide Results.


Programming Languages.


A programming language is a notation for writing programs, which are specifications of a computation or algorithm.


Programming languages can be categorized into three main parts.


  • Machine Language.

  • Assembly Language

  • High-level programming language


Features of Machine Language


  •   Executed directly on the machine

  •   Fast in operation

  •   No need of a language translator

  •   Dependence on machines.

  •   Difficult to understand by humans.


Features of Assembly language


  • Operations is comparatively slower than machine language

  • Assembly language should be translated to instructions using the language translator called “Assembler”.

  • Dependency on machines.

  • Use of symbols make it more simple to understand.


Features of High level programming language


  • Easy to understand and designed with simple english words.

  • High level languages should be translated to instructions before executing on a computer.  

  • Do not depend on machines.


Programming Paradigms


A programming paradigm is simply defined as a way or a style and approach for computer programming. The programming paradigms can be classified as follows.



Here Let’s look at the imperative and declarative programming paradigms.


Imperative programming paradigm


  • This is the oldest programming paradigm.

  • This was developed with the emergence of machine and assembly language, which is suitable for the stored program concept of the Von Neumann architecture.

  • Simply in this paradigm, the style of programming focuses on how to be done except what to be done.

  • Here, it uses statements that changes the program's state.


  Von Neumann architecture.


Declarative Paradigm


  • In declarative programming, the program is specifying the result you want. But not how to get it. So that expresses the logic of computation without describing it's control flow.


  •  Below giving an example for the difference between imperative and declarative programming.




Sources:

  • Wikipedia

  • Text books.



Comments

Popular posts from this blog

Maestro Pandith Amaradewa.

  Pandith W.D. Amaradewa.   Sri Lankabhimanya Wannakuwattawaduge Don Albert Perera, better known by his adopted name Pandith Amaradeva , was a prominent Sri Lankan vocalist, violinist, and composer who did an incomparable service to Sri Lankan music by incorporating Sinhala folk music with Indian ragas into his work. Many consider Pandit Amaradeva's contribution to the development of Sinhala music as unmatched; hence, he is occasionally cited as the "Maestro of Sri Lankan Music". Amaradewa was born on 5 December 1927 as the youngest of seven children of a carpenter, Don Ginoris Perera and Maggie Weslina Mendis, in Koralawella, Moratuwa. He entered Sri Sumangala College Panadura after completing his primary education. He went to  Lucknow, Bhathkande university for higher studies and, in 1955, Amaradewa won the All India violin competition. He was married to Wimala Gunarathne in 1962, who was a teacher.  Pandith Amaradewa has directed and composed music for many Sri L...

An inspirational video on how to overcome challenges by being yourself.

  The speech on how to overcome challenges and stop comparing yourself to others by Dean Furness was really a different experience for me. There he discussed his earlier life, which he had spent before the unfortunate situation happened in December 2011. According to his speech, a five-foot-tall, 700 pound bale of hay had fallen on him while he was going to feed their horses. And he described his feelings at that moment and how his life had changed due to this accident by letting him sit in a wheel chair forever. And he related how he stands in his mind while his abnomial muscles are no longer working. He further expressed how he faced real world situations by being disabled and how he made a path for himself as a marathoner. He also describes how he stood on his weaknesses without comparing himself to others, by being a challenge to his failures. After listening to Dean's speech, I first felt really sorry for him and his situation. But when deeply analysing the ideas he brou...