Task 4: Programming Paradigms
By Lisa Christian
The purpose of this short essay is to define and describe a few important programming paradigms. These are sometimes ways to use a couple of different paradigms to achieve or solve the same tasks. This information is to discuss a few main styles. Using a different style is like calculating the same equation using alternate methods. To be well versed in programming, it is good to learn a few, if not all.
What are the essential differences between the paradigms?
Different paradigms are used in different languages for different reasons and uses. A paradigm is a mathematical way to solve a problem. They have a logical flow of using languages to solve mathematical problems. A paradigm is a pattern. Words can be used in pattens to request computers to carry out tasks. When they repeat, so does the computer. Incrementing a counter is one example, looping an array is another. Three most common types of paradigms are procedural programming, object-oriented (OOP) and declarative.
The imperative programming paradigm is an earlier used programming paradigm that was created for Von Nuemann machines. Its simple, it uses variables and loops but it can’t solve complex problems.
The declarative programming paradigm defines programming into blocks, such as logic, function and database. It focuses on what needs to be done instead of what logic it takes to solve the tasks. (Geeksforgeeks.org, 2022) I haven’t used the declarative style of programming before or if I have, I didn’t know that it was called declarative. I do know, that it is non-imperative though.
“Imperative says how to do it, and declarative says what to do. In other words, declarative programming expresses the logic of a computation without describing its control flow.”(medium.com, 2022)
What are some of the programming languages used for these different paradigms?
JavaScript is an example of a language that can be carried out with procedural programming or object-oriented. PHP also can be coded using both of these paradigms.
When learning programming, procedural programming is often taught first because it easiest to understand. The next step is learning how methods and variables can be grouped into classes to form objects.
Some other languages that the procedural paradigm is used include: ‘C, C++, ColdFusion, Java and Pascal’. (Geeksforgeeks.org, 2022)
The imperative paradigm is used in ‘C, Basic and Fortran’. (Geeksforgeeks.org, 2022)
Some more languages that use OOP, include: ‘Simula, Java, C++, Objective-C, Python, Ruby and Smalltalk’. (Geeksforgeeks.org, 2022)
What specific advantages are provided by these different programming approaches?
Procedural for me is easiest. I love coding in it, but if I want to write huge applications where tasks are often repeated and using the same information, then using the OOP approach is more useful. It allows me to save time by not writing the same code over and over again but it is harder to master. To be the best programmer I have to know both and know when its ok to use either style.
OOP also offers advantages of ‘data security, inheritance and reusability’. (Geeksforgeeks.org, 2022)
References:
geeksforgeeks.org, 2022. ‘Introduction of Programming Paradigms.’
Accessed from: Introduction of Programming Paradigms - GeeksforGeeks on: 22/5/22.
medium.com, 2022. ‘Programming Paradigms.’
Accessed from: Programming Paradigms. What is the Programming Paradigm? | by Shivam | Analytics Vidhya | Medium on: 22/5/22.
Oxford Languages, 2022. ‘Paradigm.’
Accessed from: Oxford Languages | The Home of Language Data (oup.com) on: 22/5/22.
Comments
Post a Comment