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

Software Engineering and Indian Classical Music

Indian classical music is like a beautiful gift to humanity. It's a kind of music that born from Indian lands and has the incredible power to soothe our souls and to remind our humanity. Since I was in school, I've been passionate about two things: technology and Indian classical music. Recently, I started wondering, "How Indian Classical Music can be involved in Software Engineering?" This article is my attempt to explore this interesting question. And This is my first-person idea about that with my experience. What is Indian classical music? Indian classical music, also known as Eastern music, flows like a lifeblood through the veins of its people. It is a musical tradition deeply rooted in the rich soil of their culture. This art form, I discovered, Indian classical music is a composition of ragas and Taala, where ragas are crafted from an intricate array of musical notes known as "Swara," and Taala is all about the rhythm and timing. I've personally

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 Lankan