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...

Rise up with the World for the New Revolution with OUSL

 Bachelor Of Software Engineering(hons) OUSL   The Government of Sri Lanka (GoSL) intends to achieve a targeted US$ 5bn export revenue from the software industry by 2025. The industry estimates to reach this target, an additional 200,000 IT qualified personnel would be required. Meanwhile, a recent survey identified that even to sustain the present growth, the Sri Lankan IT industry requires more than 12,000 additional graduates a year. The GoSL has identified that an urgent solution to this burning issue could only be addressed by the Open University of Sri Lanka , the only state-owned national university conducting study programmes in the Open and Distance Learning (ODL) mode. Therefore, the Open University of Sri Lanka (OUSL) together with the University Grants Commission (UGC) has decided to rise to this national challenge by admitting 10,000 students to its Bachelor of Software Engineering (BSE) and other IT d...

A best way to enter the world of ICT, The Future Careers Bridge.

Information and Communication Technology (ICT) continues to shrink the world. As major players are facing increasing difficulties in coping with the global demand, Sri Lanka is emerging as a world's ICT destination of choice. The island is steadily transforming itself into the most preferred ICT hub in Asia thanks to the availability of the most precious resource in the world - talent. It has also become the 4th largest export earner of the country. ICT services are the 4th largest export earner of the country. The Sri Lankan ICT sector serves a number of Industry verticals with over 300 companies at present. These include Communication, Apparel and Textiles, Banking Financial Services & Insurance, Healthcare, Manufacturing, Media, Retailing, Transportation, Travel and Leisure and many more.  What is SLASSCOM?    SLASSCOM (Sri Lankas Association for Software and Services Companies) is the national chamber for the IT industry in Sri Lanka. They act as the cat...