Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

PROGRAM TITLE: ……………………………………………

UNIT TITLE: 1: Programming

ASSIGNMENT TITTLE: Assignment 2 – Paradigms

SUBMISSION DATE: NO

DATE RECEIVED: 4/9/2021

TUTORIAL LECTURER: NGUYEN MINH TRANG

WORD COUNT: 3432

STUDENT NAME: NGO THI NGAN HA

STUDENT ID: BKC19100

MOBILE NUMBER: 0349685127


Summative Feedback:

Internal verification:
INTRODUCTION
My research and development team was tasked with further investigating the best way to build
safer and more efficient software. I have looked at programming models and the advantages and
disadvantages of using different programming language approaches. Different programming
models - procedural, object-oriented, and event-oriented.

My reports include an explanation of each model, analysis of suitable IDEs, and an evaluation of
the source code that will be generated for an application.

Table of Contents
A.CONTENTS

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


programming, conduct an analysis of a suitable Integrated Development Environment (IDE).

I. procedural, object-oriented, and event-oriented models.

II. Characteristics and relationship between procedural, object-oriented, and event-oriented


models .

III. Compare and contrast the procedural, object-oriented, and event-oriented models used in a
given source code of an application.

IV. Choose the right IDE, use more advanced text editor / IDE to view the code.

V. REFERENCES
LO2: Explain the characteristics of procedural,
object-orientated and event-driven programming,
conduct an analysis of a suitable Integrated
Development Environment (IDE).
I. procedural, object-oriented, and event-oriented models.
1. Procedural Programming.
Procedural Programming may be the first programming paradigm that a new developer
will learn. Fundamentally, the procedural code is the one that directly instructs a device on
how to finish a task in logical steps. This paradigm uses a linear top-down approach and treats
data and procedures as two different entities. Based on the concept of a procedure call,
Procedural Programming divides the program into procedures, which are also known as
routines or functions, simply containing a series of steps to be carried out.

2. Object-oriented programming (OOP).

Object-oriented programming (OOP) is a programming paradigm based on the concept of


"objects", which can contain data and code: data in the form of fields (often known as
attributes or properties), and code, in the form of procedures (often known as methods).

3.Event-driven programming.

Event-driven programming is a programming paradigm in which the flow of program


execution is determined by events - for example a user action such as a mouse click, key
press, or a message from the operating system or another program. An event-driven
application is designed to detect events as they occur, and then deal with them using an
appropriate event-handling procedure. The idea is an extension of interrupt-driven
programming of the kind found in early command-line environments such as DOS, and in
embedded systems (where the application is implemented as firmware).

II. Characteristics and relationship between procedural,


object-oriented, and event-oriented models:
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
commañd 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.

Microsoft VB.net takes the event driven capabilities of Visual Basic a step further by
offering Object Oriented programming as well.

III. Compare and contrast the procedural, object-oriented, and


event-oriented models used in a given source code of an
application.

You may wonder why we don’t begin with object-oriented design from the start, there are
good reasons for not doing so. Notably, much development heavy lifting involves careful
planning and forethought of current and future design considerations. Take for instance a
postal code. Postal codes in the United States are numeric and can be represented as five
digit integer. If your record-keeping system is set up such that you have a numeric field in a
table in your database, that this field will return an error if you were to attempt to enter in
letters or symbols—fast forward two years, business has been great and your boss would
like to see expansion into Canada! Uh-oh… You designed the field to be an integer—your
validation logic is based on that integer being returned, you created business logic to handle
determining shipping costs based on the value of that specific integer using comparison
iterators (< and >)… changing it to a simple Integer will not do. That, my friends, is the
importance of forethought and why design considerations should be thoroughly analyzed
before moving forward with building your application. Tying in OO design with your
programming objectives can add considerable time for development and refinement. Having
multiple prospective use cases before beginning development can help you decide on
whether or not to abstract your codebase down into reusable modular objects.

Now before you consider dropping your Procedural Programming style from your code
wrangler habits, consider that there are detractors to OOP Design including a fair bit of
reasonable criticism warning against dangers of OOP’s “falsehood” thinking. Luca Cardelli
shares reasonable concerns in a research paper titled “Bad Engineering Properties of Object-
Oriented Languages”. By contrasting many of the Procedural Programming benefits gained
over the course of technique refinement and improvement, Luca contests that the same gains
cannot be stated so much with OO concepts. To quote from the book,

“Although reuse is a big win of object-oriented languages, it is also the case that these
languages have extremely poor modularity properties with respect to class extension and
modification. For example, it is easy to override a method that should not be overridden, or
to reimplement a class in a way that causes problems in subclasses.”

Furthermore, “Smalltalk was originally intended as a language that would be easy to learn.
C++ is based on a fairly simple model, inherited from Simula, but is otherwise daunting in
the complexity of its many features. Somewhere along the line, something went wrong; what
started as economical and uniform (“everything is an object”) ended up as a baroque
collection of class varieties.”

Quite contrasting to popular consensus that OOP has been Computer Science’s panacea for
the past 30 years—especially after the proliferation of Java in the mid to late 90s. For
instance, when you glance Stackoverflow, you find an overwhelming support for OOP so
much that many swears off “any hint of Procedural Programming” as inferior with regards
to code reusability, performance, and separation of concerns. However, the counterpoint to
OOP is that often times, budget and complexity constraints will force teams to pick and
choose principles when convenient and not necessarily follow concepts consistently due to
overcomplexity and expense (seen often in cross-cutting concerns between subclasses to
shortcut/subvert the process of refactoring proper encapsulation and prototypical inheritance
when passing messages between objects).

III. What is the definition of Text Editor, IDE?


Text Editor

Text editor (translated into Vietnamese: a text editor) is a type of software that helps us to
work with plain text in files.

Because the source code needs to be saved in a plain text format, when programming, we can
use these text editors to program.

IDE

IDE (or Integrated Development Environment) is a more advanced type of text editor
designed to assist developers in application development. An IDE will provide all the
features of a text editor in addition to other features to help us easily detect errors (debug) in
the application, test the application (test) .. . Easily.

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.

IV. Choose the right IDE, use more advanced text editor / IDE
to view the code.
Though the basic functioning is the same, each JS IDE and source code editor has some
distinct advantages, and disadvantages as well, over others. Here is our pick of the 14 best
JavaScript IDEs and Source Code Editors to use in 2021:

1. Atom

Atom

Initial Release – February 2014


Type – Source Code Editor (Open-source)

Atom is one of the most popular source code editors used for JavaScript development. The
modern code editor is flexible and highly customizable. A cross-platform tool, Atom is easy
to install, offers a significant speed gain, and is completely free to use.

The basis of Atom is Electron, which is a very popular framework for building cross-
platform desktop applications using JavaScript. Smart code completion is inherent to Atom,
which also boasts an intuitive file system browser. There are also several UI and syntax
themes available.

The ability of Atom can be extended by means of adding packages, such as the Auto-close
HTML tags, Minimap, and Linter. Atom has an inbuilt package manager that simplifies
searching available packages and installing them on priority.

2. AWS Cloud9

AWSCloud9

Initial Release – 2010

Type – Cloud IDE (Proprietary)

Written completely in JavaScript and using NodeJS on the back-end, AWS Cloud9 is
probably one of the best online IDEs for developing JS applications. Additionally, it supports
development for C, C++, Go, Node.js, Perl, PHP, Python, and Ruby projects.

Anyone looking to use AWS Cloud9 must have an AWS account. The online IDE comes
with an inbuilt terminal that provides support for npm and basic Unix commands. Code
completion, real-time language analysis, and simultaneous editing are some of its notable
features.

AWS Cloud9 comes with variable/function name refactoring and syntax highlighting for JS.
Code reformatting is possible via JSBeautify and CSSLint. Customizable key-bindings is
also available, which includes presets for Emacs, Sublime Text, and Vim.

The functionality of AWS Cloud9 can be extended by using plugins. Moreover, a variety of
themes are available to give the IDE a look of your choice. In addition to offering a
debugger, the IDE offers tabbed file management.

AWS Cloud9 has an inbuilt image editor and provides support for several Version Control
Systems, including BitBucket, GitHub, and Mercurial. The IDE provides support for
deployment to a variety of platforms, such as Google App Engine, Heroku, Joyent, and
Microsoft Azure.

3. Brackets

Brackets

Initial Release – November 2014


Type – Source Code Editor (Open-Source)

Created by Adobe Systems, Brackets is a fresh front-end development tool available under
the MIT license. It is continuously rising as a leading tool choice by JS developers. The
source code editor offering built-in support for JavaScript is fast and lightweight.

One of the most interesting features supported by Brackets is Live Preview. It allows seeing
how the changes in code work in real-time by automatically opening a new Chrome window.
The JSLint feature is responsible for verifying the JS file while it is being saved using
Brackets.

Like its contemporaries, Brackets comes with the automatic code completion feature.
However, it is way faster than what competitors offer. In order to debug JS apps built using
Brackets, the Theseus extension is there. It works with both Google Chrome as well as
NodeJS.

The ability of Brackets can be enhanced by means of installing extensions. Brackets offer a
crystal clear interface for searching and adding extensions. Some useful extensions to add to
Brackets are Autoprefixer, Code-folding, Markdown Preview, Smart Highlighting, and
Snippets.

4. Codeanywhere

Codeanywhere

Initial Release – May 2013

Type – Cloud IDE (Free/Premium)

Codeanywhere is a cloud-based, cross-platform IDE written in JavaScript. It allows


developers to write, edit, and run web development projects directly from a web browser. In
addition to JavaScript, the online IDE provides support for over 70 programming languages.

The editor offered by Codeanywhere is based on the CodeMirror and utilizes OpenVZ
containers for development environments, known as DevBoxes. In addition to allowing the
user to run code in DevBoxes, the IDE enables connecting with one’s own VMs via FTP or
SSH.

Codeanywhere comes with an inbuilt terminal that supports basic Unix commands as well as
npm. It has a built-in debugger, offers tabbed file management, and supports deployment to
Heroku.

It is possible to connect to Dropbox, Google Drive, and OneDrive with Codeanywhere. The
cloud IDE provides support for Bitbucket, Git, and GitHub code repositories.

5. Eclipse

Eclipse

Initial Release – November 2001


Type – Java-specific IDE (Open-source)

Initially influenced by IBM VisualAge, Eclipse is one of the big three Java IDEs. It comes
with an extensible plugin system. In order to use Eclipse for JavaScript development as well
as with other programming languages, specific plugins need to be installed.

Eclipse was one of the first IDEs to run under GNU Classpath. The integrated development
environment offers a remarkable combination of performance, robustness, and stability.
Setting up the Oomph Project allows automating and reproducing identical workspaces.

Since Eclipse Mars, vigorous efforts have been made to make Eclipse more JS-friendly. This
is evident with the performance enhancement in the JSDT (JavaScript Development Tools).
Eclipse supports a new Docker UI, enabling building Docker images and containers with the
Docker CLI.

Almost all download packages for Eclipse integrate with Git. One of the amazing feature
supported by Eclipse is the automated error reporting. The feature allows the IDE to
automatically sent found bugs to eclipse.org.

After processing, these bugs are converted into Bugzilla entries. Hence, it allows
troubleshooting via crowdsourcing in place of relying on a few people or a small
community.

6. IntelliJ IDEA

IntelliJ IDEA

Initial Release – January 2001

Type – Java-specific IDE (Free edition/Commercial edition)

With a primary focus on maximizing developer productivity, IntelliJ IDEA is one of the most
beloved IDEs. In addition to providing support for a number of programming languages
other than Java and JS, the ergonomic design supported by the IDE offers ease-of-use.

One of the most amazing features of IntelliJ IDEA is its ability to automatically add tools
that are relevant to the context. The integrated development environment offers a number of
smart code assistance features for JavaScript development.

IntelliJ IDEA is capable to automate repetitive programming tasks to cut development time.
The IDE offers advanced code completion, built-in static code analyzer, and integrated
version control.

7. NetBeans

NetBeans

Initial Release – 1997

Type – Dedicated IDE for Java


Other than its popular use for Java development, NetBeans is able to provide powerful
integrated development environment capabilities in favor of JavaScript. The multi-platform
IDE enables application development using modules (or modular software components)

There is a smaller time gap between installing NetBeans and using the same for building
applications. Smart code completion, syntactically and semantically highlighting code, built-
in support for Git, Mercurial, and Subversion are some of the major highlights of the IDE.

It is very easy to modify the NetBeans workspace. You can drag and reposition tabs in the
application frame or customize the buttons in the toolbar to suit your application
development style. You can also set your own keyboard shortcuts.

8. PhpStorm

PhpStorm

Initial Release – 2009

Type – PHP-specific IDE (Commercial)

PhpStorm is a cross-platform IDE built on top of the IntelliJ IDEA platform. Though it is
developed especially for PHP development, it has some great features to be used as a
JavaScript IDE.

Like the IntelliJ IDEA, the functionality of PhpStorm can be extended by means of plugins.
PhpStorm supports zero-configuration debugging in addition to automated refactorings, error
prevention, syntax highlighting, and on-the-fly code analysis.

In order to enhance the code quality, PhpStorm comes with hundreds of code inspections.
These verify the code as it is written and offer quick-fixes for improving the code quality.
Pressing Alt and Enter together will display various options available for each inspection.

PhpStorm comes with inbuilt tools for testing and profiling. It offers a unified UI in order to
work with numerous popular Version Control Systems, including Git, Mercurial, and
Perforce. Moreover, the IDE offers tools to work with databases and SQL in a project.

9. SourceLair

SourceLair

Initial Release – January 2011

Type – Web-based online IDE (30-day free trial/Commercial)

Written in Django, a leading Python framework, SourceLair is an online IDE. For every
project created, SourceLair offers an isolated development environment. Each of the
development environment is built as per the typical requirements and comes with several
tools.
One of the most interesting features of SourceLair is that all projects come with a dedicated
development server that is publicly accessible. This means that it is possible to share the
project with clients and co-workers by simply sharing the project’s Public URL with them.

If you are working on a project that uses a separate database server then you can simply add
it to the project in a few clicks. Automatic indentation, code folding, smart autocompletion,
and syntax highlighting are some of the desirable features supported by the SourceLair
editor.

SourceLair offers real-time error reporting for JavaScript powered by JSHint (and also for
Python powered by Pylint). The online IDE comes with a full-featured Linux terminal and a
robust keyboard control layout.

Other noteworthy highlights of SourceLair includes browsersync, drag and drop support, Git
integration, inbuilt pip and npm support, single-click app deployment to Heroku, split view,
and Sublime Text key bindings.

10. Sublime Text

Sublime Text

Initial Release – January 2008

Type – Source Code Editor

The latest version of Sublime Text is SBT3, which transforms the tool from being a source
code editor into a pseudo-IDE. Sublime Text is cross-platform and offers a high degree of
customization.

Sublime Text flaunts a clutter-free interface and significant speed boost. Enhanced pane-
management, Go to definition, and Go to Symbol are some of the out-of-the-box features.
For enabling syntax highlight for ES6 and ReactJS code, the Babel plugin is available.

Some important plugins that anyone using Sublime Text for JS development must use are
DocBlockr, JSFormat, SideBar Enhancements, and SublimeLinter.

V. REFERENCES
- Procedural Programming: https://hackr.io/blog/procedural-programming

- Object-oriented programming (OOP):


https://en.wikipedia.org/wiki/Object-oriented_programming

- Event-driven programming:
https://www.technologyuk.net/computing/software-development/software-
design/event-driven-programming.shtml#:~:text=Event%2Ddriven
%20programming%20is%20a,operating%20system%20or%20another
%20program.
- Data type : https://vi.wikipedia.org/wiki/Ki%E1%BB%83u_d%E1%BB
%AF_li%E1%BB%87u#:~:text=Trong%20khoa%20h%E1%BB%8Dc
%20m%C3%A1y%20t%C3%ADnh%20v%C3%A0%20l%E1%BA
%ADp%20tr%C3%ACnh%20m%C3%A1y%20t%C3%ADnh,th
%E1%BB%B1c%2C%20s%E1%BB%91%20nguy%C3%AAn%20hay
%20Boolean.

- Compare and contrast the procedural, object-oriented, and event-


oriented models used in a given source code of an application:
https://www.codementor.io/learn-programming/comparing-programming-
paradigms-procedural-programming-vs-object-oriented-programming

Text Editor, IDE: https://www.codehub.com.vn/Lap-Trinh-Co-Ban-Danh-


Cho-Nguoi-Moi-Bat-Dau/Text-Editor-va-IDE#:~:text=Text%20editor
%20(d%E1%BB%8Bch%20sang%20ti%E1%BA%BFng,editor%20n
%C3%A0y%20%C4%91%E1%BB%83%20l%E1%BA%ADp%20tr
%C3%ACnh.

- Key components of an IDE:


https://www.redhat.com/en/topics/middleware/what-is-ide

- Choose the right IDE, use more advanced text editor / IDE to view the
code: https://hackr.io/blog/best-javascript-ide-source-code-editors

- Characteristics and relationship between procedural, object-oriented, and


event-oriented models: https://www.quora.com/What-are-the-
relationships-between-programming-procedural-object-oriented-and-
event-driven-paradigms

You might also like