Pros and Cons of Programming Paradigms: Procedural, Object-Oriented, and Event-Driven, Essays (university) of Programming Paradigms

An in-depth analysis of procedural, object-oriented, and event-driven programming paradigms. It covers their definitions, key features, advantages, disadvantages, and a comparison between them. Additionally, it discusses suitable IDEs and code editors for programming in these paradigms.

Typology: Essays (university)

2019/2020

Uploaded on 07/27/2022

Vu-Nguyen-73
Vu-Nguyen-73 🇻🇳

4.2

(5)

7 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
0
PROGRAM TITLE: HIGHER NATIONAL DIPLOMA IN COMPUTING
UNIT TITLE: PROGRAMMING
ASSIGNMENT NUMBER: 02
ASSIGNMENT NAME: PARADIGMS
SUBMISSION DATE: APRIL 24, 2021
DATE RECEIVED: …………………………………………….
TUTORIAL LECTURER:
WORD COUNT:
STUDENT NAME:
STUDENT ID:
MOBILE NUMBER:
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Pros and Cons of Programming Paradigms: Procedural, Object-Oriented, and Event-Driven and more Essays (university) Programming Paradigms in PDF only on Docsity!

PROGRAM TITLE: HIGHER NATIONAL DIPLOMA IN COMPUTING

UNIT TITLE: PROGRAMMING

ASSIGNMENT NUMBER: 02

ASSIGNMENT NAME: PARADIGMS

SUBMISSION DATE: APRIL 24, 2021

DATE RECEIVED: …………………………………………….

TUTORIAL LECTURER:

WORD COUNT:

STUDENT NAME:

STUDENT ID:

MOBILE NUMBER:

INTRODUCTION

The research and development team I work with has been tasked with further investigation into how best to build more efficient, secure software. I have been asked to look into programming paradigms and the advantages and disadvantages of using different programming language approaches. In this document, I will cover findings from research into the characteristics of different programming paradigms

  • procedural, object-orientated, and event-driven programming. This report’s first part is an explanation of each paradigm. The next part is an analysis of suitable IDEs and an evaluation of source code that would be generated for an application.

I. Paradigms

A. Procedural programming

1. Definition of procedural programming

Procedural programming is a programming paradigm. It is usually the first type of paradigm a new programmer will learn. Following this paradigm, the programmer will write down code that will directly instruct a machine on how to finish tasks. It divides the program into procedures, which are also known as routines or functions, and follows them in a linear top-down approach.

2. Key features of Procedural Programming https://hackr.io/blog/procedural-programming

Predefined functions : They are instructions identified by a name. Once that name is called, the set of steps will be executed by the program. One example of it is the len(string) function in Python, which will return the number of characters in the string parsing in ● Local variables : A local variable is a variable declared inside a method, and can only be used in the scope it is defined in ● Global Variable : A global variable is a variable that is declared outside all functions in the program. Therefore, global variables can be used everywhere in the program ● Modularity : Modularity is when two dissimilar systems have two different tasks at hand but are grouped to conclude a larger task first. Every group of systems then would have its tasks finished one after the other until all tasks are complete ● Parameter Passing : This mechanism helps parse arguments to functions, or procedures. There are four types of parsing: pass by value, pass by reference, pass by the result, pass by value results and pass by the name

3. Advantages of Procedural Programming

● Great for general-purpose programming ● Easy to learn ● The code can be reused in the different part of the program easily ● Simplicity ● Easy to track the program’s flow

4. Disadvantages of Procedural Programming

● Can not relate with real-world objects ● The code usually can not be reused in another program

● Not so secure ● Hard to manage when the codebase expands B. Object-oriented programming

1. Definition of Object-oriented programming

Object-oriented programming or OOP is a programming paradigm that views all parts of the program as different objects, those objects then work together to solve a particular task.Key features of Object-oriented programming ● Encapsulation : This is the idea that all components that make up an object should be kept within that object ● Abstraction : Abstraction help maintain a large codebase easier by making each object should only expose a high-level mechanism to the other objects to use ● Inheritance : If you think more about the idea everything is an object , you will notice many objects have some common things. So, we can use inheritance to create a (child) class by delivering all fields, and methods from another (parent) class to it. ● Polymorphism : So we have already known about Inheritance, simply put, polymorphism gives a way to use a child class exactly like its parent, but each child class can keep its methods.

2. Advantages of Object-oriented programming

● Can be used to manage a large codebase ● Easy to understand the structure of the program since it mimics real world ● The code is reusable in other programs

3. Disadvantages of Object-oriented programming

● Over-generalization ● Harder to learn and create a program using OOP ● Using more memory

Focuses on the execution of steps Focuses on objects and data Focuses on the user interface Most common languages follow this paradigm: Basic, Python Most common languages follow this paradigm: C++, Java Most common languages follow this paradigm: Visual Basic, C#

E. Conclusion

Now a day, procedural programming is usually taught to new programmers, while Object-oriented programming and Event-driven Programming are the most used in companies. Every paradigm has its advantages and disadvantages, we should know when to use which paradigm for a project. Moreover, since we need larger and complicated programs, programming paradigms will continuously evolve.

II. Code editors and IDEs

A. Integrated Development Environment

From Wikipedia[1]: “An Integrated Development Environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools, and a debugger. Some IDEs, such as NetBeans and Eclipse, contain the necessary compiler, interpreter, or both”. Here are some key components that made up an IDE:

1. Source-code Editor

A source-code editor looks like a text editor but with more features. Some of them are code highlight, autocomplete code, suggestions when typing, and so much more. It is used to editing and writing the source code of a program. We can say that a Source-code editor in an IDE is a text editor that gets enhanced to maximize support for developers typing code. A source-code editor can be a standalone application as well, we will discuss it later in “Part B: Code Editor”. Without a source-code editor, the programmer will likely not be able to do most of his work.

2. Build Automation

This is one of the reasons we want to use an IDE to write a program. IDE helps us build our software easily, usually, it just needs a few clicks in the GUI of the IDE to finish the job. With automatic build in IDE, programmers do not have to know about the engine behind the creation of their product. The IDE will finish most of the configuration for the developers. This process usually includes: Compiling the source code into the computer language, also known as binary code, packaging those binary codes, and running some tests

3. Debugger

One other great component of an IDE is the debugger. It is a tool that helps developers to test and debug their code. It usually runs the pieces of code that need to be debugged under controlled conditions while keep updating the data for the developers, so they can track the program process. B. Advanced text editors in viewing code Now we will discuss the uses of the addition of advanced text editors to view code such as Visual Studio Code, PyCharm, Sublime Text, Atom, etc.

1. What is an advanced text editor?

When saying advanced text editor, we mean it to be a standalone code editor. It is an application that allows you to write and modify your code. A code editor can be a web-based application like CodePen or Repl.it; or it can be a desktop-based application like VS Code and Sublime Text. However, no matter what kind of platform they run on, a code editor will always provide you a convenient way to write and run your code

Sometimes has plug-ins to work with different technologies Usually has fewer plug-ins Can run on more platforms Usually, just run on desktop Mostly free to use Some required payment to use More flexible More robust when using for its specific technologies

References

[1] Wikipedia 2021, Integrated development environment , Wikipedia, viewed 23 April 2021,