Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Programming Paradigms: Procedural, Object Oriented, and Event Driven, Cheat Sheet of Computer Vision

Software EngineeringComputer ScienceProgramming Languages

And compares procedural, object oriented, and event driven programming paradigms, their advantages and disadvantages, key components of an IDE, and contrasts them in the context of a given application's source code. It also explains the differences between object oriented and event driven programming.

What you will learn

  • What are the limitations of procedural and object oriented programming?
  • What are the key components of an IDE?
  • How does object oriented programming improve software development productivity?
  • What are the differences between object oriented and event driven programming?
  • What are the advantages and disadvantages of procedural programming?

Typology: Cheat Sheet

2020/2021

Uploaded on 09/27/2021

jun-pham
jun-pham 🇮🇸

26 documents

1 / 14

Toggle sidebar

Related documents


Partial preview of the text

Download Programming Paradigms: Procedural, Object Oriented, and Event Driven and more Cheat Sheet Computer Vision in PDF only on Docsity!

PROGRAM TITLE: GUIDELINE UNIT TITLE: GUIDELINE ASSIGNMENT NUMBER: 2 ASSIGNMENT NAME: GUIDELINE SUBMISSION DATE: 01/05/ DATE RECEIVED: 05/05/ TUTORIAL LECTURER: Nguyen Minh Trang WORD COUNT: 3479 STUDENT NAME: Hoang Thi Hien STUDENT ID: BKC MOBILE NUMBER: 0388334345

Summative Feedback: Internal verification:

Contents

 - Assignment 
  • Introduction.................................................................................................
  • driven programming.................................................................................... LO2. Explain the characteristics of procedural, object-orientated and event-
      1. Procedural, object-orientated and event-driven paradigms..............................................................................
      • Procedural Programming....................................................................................................................................
      • Event-driven paradigms......................................................................................................................................
      • Object-orientated Programming - OOP..............................................................................................................
      1. Characteristics and the relationship between them:..........................................................................................
      • 2.1: Characteristics between Procedural, object-orientated and event-driven paradigms................................
      • 2.2: The relationship between Procedural, object-orientated and event-driven paradigms............................
    • of an application................................................................................................................................................... 3. Compare and contrast the procedural, object oriented and event driven paradigms used in given source code
      1. Define what is an IDE, key components of an IDE............................................................................................
      • What is an IDE?.................................................................................................................................................
      • Key components of an IDE................................................................................................................................
      • Basis IDE feature:..............................................................................................................................................
  • Reference...................................................................................................

Introduction

In this criteria I will firstly describe what each programming languages are event driven programming, object oriented and Procedural; Furthermore describing the applications and limitations of them providing with image and a conclusion at last.

LO2. Explain the characteristics of procedural, object-orientated and event-driven

programming.

1. Procedural, object-orientated and event-driven paradigms

A programming language is a formal language comprising a set of strings that produce

various kinds of machine code output. Programming languages are one kind of computer

language, and are used in computer programming to implement algorithms.

Procedural Programming Procedural language is a list of instructions telling a computer, step- by-step. In this programming practice developer write line by line code which executes a single action each line. In procedural programming first line of code is executed, then the second, then the third and so on, lines cannot jump from the 1st to the 7th to achieve something it must first complete 1-6 in order to get to the 7th line. procedural programming also focuses on the idea that all algorithms are executed with functions and data that the developer has access to and is able to change. Procedural programming uses a top down approach to executing codes Advantages and Disadvantages of Procedural Programming Procedural Programming comes with its own set of pros and cons, some of which are mentioned below. Advantages  Procedural Programming is excellent for general-purpose programming  The coded simplicity along with ease of implementation of compilers and interpreters  A large variety of books and online course material available on tested algorithms, making it easier to learn along the way  The source code is portable, therefore, it can be used to target a different CPU as well  The code can be reused in different parts of the program, without the need to copy it  Through Procedural Programming technique, the memory requirement also slashes  The program flow can be tracked easily

Disadvantages  The program code is harder to write when Procedural Programming is employed  The Procedural code is often not reusable, which may pose the need to recreate the code if is needed to use in another application  Difficult to relate with real-world objects  The importance is given to the operation rather than the data, which might pose issues in some data-sensitive cases  The data is exposed to the whole program, making it not so much security friendly  Event-driven paradigms Event driven programming is the outline for particularly for window application that include client intelligent. There are a variety of highlights that make Event driven that makes the application substantially quicker and simple. There are a few highlights, for example, simplified question the frame. There are some basic control, for example, catch, name, picture and other. Operating system could be for instance an example of an Event Driven Language. The event are utilised with highlights, for example, Event Triggers, Event Handlers, Event Loops, Sensors in which this Programming application can be utilised inside designer’s every day survives Event Handlers (e.g. clicking a mouse button is an event handler). Event Driven Programming has a noteworthy decent Ease of Use and any designer can without much of a stretch take in this Programming application and can begin planning and creating projects upon as it gives you insights and blunders inside the lines of Visual Basic code to settle the code, so the task is working completely without any mistakes.

Object-orientated Programming - OOP OOP languages are very popular and they widely used in various different software applications and games. To think about this simply imagine a airplane it has 300 seats, two wings, 2 massive rotor fans and various controls. Now if we want to break it down we can create objects of those 300 seats and instead of making them one at a time we can design the perfect seat once and then have the program make 299 of them exactly the same way. In OOP programming this is called creating an OBJECT. That’s the first word in OOP. In OOP an object presents an entity in the real world (the properties we talked about before). An OOP program is a collection of objects that interact to solve a task or problem. Example of object orientated programming languages are C#, Java, Action Script, C++, Objective C, Ruby on Rails and others. There are four basic principles in Object-Oriented programming: Encapsulation , Abstraction , Inheritance and Polymorphism. Basically, some other OOP advantages include: Improved software development productivity: OO programming is modular, as it provides separation of duties in object-based program development. It is also extensible, as objects can be extended to include new attributes and behaviors. Objects can also be reused within an across applications. Because of these three factors; extensibility, modularity, and reusability. Faster development: Reuse enables faster development. Object-oriented programming languages come with rich libraries of objects, and code developed during projects is also reusable in future projects. Lower cost of development: The reuse of software also lowers the cost of development. Typically, more effort is put into the OO analysis and design, which lowers the overall cost of development.

Higher-quality software: Faster development of software and lower cost of development allows more time and resources to be used in the verification of the software. Although quality is dependent upon the experience of the teams, OO programming tends to result in higher-quality software Other OOP disadvantages are: Steep learning curve: The thought process involved in OO programming may not be natural for some people, and it will take the time to get used to it. The complexity of creating programs: it is very complex to create programs based on the interaction of objects. Some of the key programming techniques, such as inheritance and polymorphism, can be a big challenging to comprehend initially.

2. Characteristics and the relationship between them: 2.1: Characteristics between Procedural, object-orientated and event-driven paradigmsProceduralProcedural Application Procedural language application rush to take in this language. This programming language is useful for starters to learn in light of the fact that it is straightforward and compose. Procedural language regards use for high application to run quick. E.g. for when Procedural Programming would be for instance, when a client enters specific details into an application shape for enrolment zones, for example, joining to sites , the enlistment is prepared to the following stage in which they are required to login with the points of interest they enrolled with to have the capacity to affirm the enrolment is finished this technique requires Procedural Programming, Procedural Programming likewise includes capacities, for example, capacity to issue tackle computations for logical utilise.  Limitations of Procedural The limitations of procedural are that there is an absence of reusable and huge of hard program may utilise thousands of line of code. In the event that the company has a similar reason in future at that point there can duplicate from that point leaving project and change it yet that is the troublesome errand. The lines of code in a program are difficult to see however before you change the program then you ought to see all the piece of it. The Limitations of this would be that Procedural Programming can be tedious to compose and can’t be identified with genuine events. Procedural Programming is utilised to teach the Computer to perform basic programmed directions. This Programming language can be hard to control points of interest into once it has been coded onto the projects design highlights and so on. Additionally, when performing huge undertakings on Procedural based projects, the restrictions of his future the application transforms these huge tasks coded onto the application into something many refer to as “Spaghetti-Code. This is the point at which a considerable measure of code is altered that the

new software engineer going onto the projects needs 2 months to get ready and comprehend what is occurring inside the undertaking as it’s extremely convoluted to see straight away.  Object orientedLimitations of Object Oriented Programming The limitations of Object-oriented Programming are that it takes long to learn so you need to take in the hypothetical of OOP before you make it. This language is a slower execution contrasted with Procedural. It is higher complex PC condition that is required for this program language. Furthermore another limitation is the size of OOP itself; other programs are much smaller although OOP store more size in your internal or external hard drive however now they take up less space than before. Other Limitations of Object Oriented Programming is that Object Oriented Programming has no additional instruments that build up the application which could be utilised as a part of Software Websites when endeavouring to utilise PHP coding as this lone uses programming like Adobe Dreamweaver and VB.net which have these devices to have the capacity to build up the application thus. In addition, another urgent confinement of Object Oriented Programming is the way that the improvement must be done physically so in the event that you acquire an expansive task with a vast record measure, the Programming application will have a broad measure of code inside Standard applications.  Encapsulation Encapsulation is only securing anything which is inclined to change. Rational behind Encapsulations that if any usefulness which is all around Encapsulated in code i.e. kept up in only one place and not scattered around code is anything but difficult to change. This can be better clarified with a straightforward case of Encapsulated in Java. We as a whole realise that constructor is utilised to make protest in Java and constructor can acknowledge contention. Assume we have a class Loan has a constructor and then in different classes you have made occasion of credit by utilising this constructor. Presently prerequisites change and you have to incorporate period of borrower too while taking advance. Since this code isn’t all around exemplified i.e. not restricted in one place you have to change wherever you are calling this constructor i.e. for one change you have to alter a few document rather than only one record which is more blunder inclined and dreary.  Polymorphism The word Polymorphism methods for some forms. In programming this word is intended to reuse the single code different circumstances. Clearly when we do legacy between two classes, every one of the techniques and properties of the top of the line are determined to alternate class with the goal that this turns into the type class which adobes all the usefulness of base class. It can likewise has its own different strategies.

In any case, there is a major issue in acquiring the below average to the top notch as it adobes every one of the strategies same as the base class has, which implies that after legacy both(base class& youngster class) have the techniques for same name and same body. Polymorphism is utilised to expel the issue which is appeared in the above code. It is done not by changing the name of the strategies for both base and inferred class. Infect it is finished by including the “virtual” watchword before the base class strategy, and the “override” catchphrase before the determined class technique.  Inheritance Inheritance is particular to question situated programming, where another class is made from a current class. Inheritance (frequently alluded to as subclasses) originates from the way that the subclass (the recently made class) contains the traits and techniques for the parent class. The principle preferred standpoint of Inheritance is the capacity to characterise new characteristics and new strategies for the subclass which are then connected to the acquired qualities and techniques. This can be utilised to make an exceptionally particular progressive class structure. The greatest favourable position is that there is no compelling reason to begin starting with no outside help when needing to practice a current class. Therefore, class libraries can be obtained, giving a base that would then be able to be specific freely (the organisation offering these classes has a tendency to ensure part information utilising epitome).  Event driven paradigmsEvent driven Programming Application Event driven Programming computer programs is a way that enables the program to react to a wide range of information sources or events. This is a paradigm in which the flow of the program is controlled by the many events. The events can be from any source, for example, clocks and sensors. A case of an event driven situation would resemble a wake up timer set for a specific time to do a specific assignment like ring and communicate something specific saying “Wake Up!”.  Limitations of Event Driven Programming Limitations of event driven programming would be that it doesn’t naturally enable you to enter event loops and requires the client to physically enter loops. Moreover, it additionally requires a lot of preparing power because of the need of ceaselessly dynamic event loops. Other limitations of Event Driven Programming is that the Program doesn’t naturally enable you to adjust and apply Event Loops and triggers which requires the client to physically enter for the circles. In addition, this empowers the Application to utilise huge measure of handling force and CPU inside the undertaking/application because of the need of nonstop dynamic running of Event Loops occurring when the application/project is being tried/utilised.

2.2: The relationship between Procedural, object-orientated and event-driven paradigms  Simply speaking, the basic concept of programming is procedural only. The event driven and object oriented concepts just help the programmer to manage the complexity of very large programs.  Programs may often become very large and contain hundreds of thousands of lines of code. Old programming languages like COBOL handled this complexity by allowing the creation of paragraphs or by moving some code to external programs which can be called from a main, central or controlling program which assigns values to those variables which will be used as parameters by the called program. The called program would return the control to the calling program on termination and may or may not return some values as instructed. Calling can be nested when a called program calls another sub-program with or without parameters and may or may not receive some return value and so on.  This methodology appears simple but can become extremely frustrating and unmanageable when program design and coding is assigned to a large number of programmers who may be spread across several locations e.g. Bengaluru and Silicon Valley.  Event driven programming simply uses event handlers to keep a large amount of code handy and available for use if and when required. If there is no requirement for this code, then it just rests on the sidelines without interfering with or cluttering the other code. Now the program is a cluster of subprograms, each assigned to a distinct and different event of a command button, drop down list or text box etc. The controlling program (for example, a form in Visual Basic) simply keeps track of various events and fires the code inside the event handler set aside for that particular event.  Object oriented programming combines the programming capabilities of procedural and event driven programming and goes one step further. The functions and variables of a module are kept in an object. Objects cannot be created randomly. Each object emerges from a class. A class is a blueprint, a design or an architecture for creating objects. A class encapsulates a lot of functions. Variables can exist in a class or inside its functions. A function can encapsulate other functions and variables and so on. It's just like a good doctor would prescribe a medicine that is neatly packaged in capsules rather than in a big bottle or box.  Classes can be created from other classes. This is called inheritance. A function or a variable belonging to one object can be given the same name as given to one belonging to another object. This is called polymorphism.  Objects, which are created from classes interact with the main, controlling function and with other functions, variables and objects in a disciplined, well defined and organised way

3. Compare and contrast the procedural, object oriented and event driven paradigms used in given source code of an application Programming paradigm is another method of classification of programming languages. Examples of paradigms include procedural paradigm (BASIC, COBOL, Ada), object-oriented paradigm (Java, C++), declarative paradigm (Prolog) and functional paradigm (LISP, Scheme), event-driven paradigm (VB, C#). Procedural Programming Object-Oriented Programming Event driven paradigms

Provides character user interface to write the commands. Provides command writing in modules. Provides graphical user interface to create the programs. Commands are written in linear fashion and executed also in linear fashion. Objects and functions are prepared for interaction to perform specific tasks. Actions are defined on events. These events could be occurred by mouse clicking and moving or keyboard strokes. Focuses on sequential execution of steps. Focuses on objects or data and facilitate to secure it from unauthorized access. Focuses on selecting user interface. Most common languages which follow this paradigm are Basic, Fortran and COBOL. Most common languages which follow this paradigm are Smalltalk, C++ and JAVA. Most common languages which follow this paradigm are Visual Basic and C#.

4. Define what is an IDE, key components of an IDEWhat is an IDE? An integrated development environment (IDE) is a software suite that consolidates basic tools required to write and test software.

Developers use numerous tools throughout software code creation, building and testing. Development tools often include text editors, code libraries, compilers and test platforms. Without an IDE, a developer must select, deploy, integrate and manage all of these tools separately. An IDE brings many of those development-related tools together as a single framework, application or service. The integrated toolset is designed to simplify software development and can identify and minimize coding mistakes and typos. Some IDEs are open source, while others are commercial offerings. An IDE can be a standalone application or it can be part of a larger package.  Key components of an IDE An IDE typically consists of:  Source code editor : A text editor that can assist in writing software code with features such as syntax highlighting with visual cues, providing language specific auto-completion, and checking for bugs as code is being written.  Local build automation : Utilities that automate simple, repeatable tasks as part of creating a local build of the software for use by the developer, like compiling computer source code into binary code, packaging binary code, and running automated tests.  Debugger : A program for testing other programs that can graphically display the location of a bug in the original code.  Basis IDE feature:

 Visual Studio - Visual C++, VB.NET, C#, F# and others: Visual C++ is part of the general

"C suite" of programming languages often used for many different types of

development projects. The full name of the product is Microsoft Visual C++, which

is sometimes abbreviated as MSVC or VC++.

 Eclipse - Java, JavaScript, PHP, Python, Ruby, C, C++ and more: Eclipse is an open-

source platform of extensible software development application frameworks,

tools and run times that was initially created as a Java-based integrated

development environment (IDE).

 Netbeans - C, C++, Python, Perl, PHP, Java, Ruby and more: NetBeans is an open-source

integrated development environment (IDE) for developing with Java, PHP, C++,

and other programming languages. NetBeans is also referred to as a platform of

modular components used for developing Java desktop applications.

 …

Reference

PROCEDURAL, OBJECT ORIENTED AND EVENT DRIVEN PROGRAMMING | BARTLEBY

In-text: (Procedural, Object Oriented And Event Driven Programming | Bartleby, 2021) Bartleby.com. 2021. Procedural, Object Oriented And Event Driven Programming |Bartleby. [online] Available at: <https://www.bartleby.com/essay/Procedural-Object-Oriented-And-Event-Driven Programming-FKSNBCECFL9X> [Accessed 8 May 2021]. SAHER, F. what is the difference between Object Oriented Programming and Event Based/Driven Programming? In-text: (Saher, 2021) Saher, F., 2021. what is the difference between Object Oriented Programming and Event Based/Driven Programming?. [online] C-sharpcorner.com. Available at: <https://www.c- sharpcorner.com/interview-question/what-is-the-difference-between-object-oriented- programming-and-event-baseddriven-programming> [Accessed 8 May 2021]. WHAT IS AN IDE? | CODECADEMY In-text: (What Is an IDE? | Codecademy, 2021) Codecademy. 2021. What Is an IDE? | Codecademy. [online] Available at: https://www.codecademy.com/articles/what-is-an-ide [Accessed 8 May 2021].