Unit Six Assignment 1

advertisement
Unit Six Assignment 1
Chris Boardley
Task 1
P1 - Describe the application and limits of procedural, object oriented
and event driven programming paradigms.
The Procedural Paradigm
Procedural programming basically uses a
set of computational steps (procedures)
in order to accomplish a specific task.
This is a fast process and because of it’s
simplistic approach, it is often the
paradigm used when teaching
programming to beginners due to it’s
relatively simple logic.
When writing code for complex software,
procedural programming would not be
the preferred paradigm because the
complex software would require many
lines of code, making it an unwieldy and
perhaps confusing way of coding.
Procedural Programming Languages
can include –

C.

C++.

Fortran.

Pascal.

Basic.
The Object Orientated Paradigm
Object orientated programming focuses
on using objects rather than procedures
in order to accomplish a task. This can
be beneficial because it is modular,
which allows separate objects to respond
to the same instruction differently. Also,
it allows the programmer to alter
specific objects without altering the
whole program.
OOP has a steep learning curve, requires
a lot of planning and consideration of the
relationships between objects can be
difficult to get used to. OO programs also
tend to be larger in size, which can be a
problem in some circumstances.
Object Orientated Languages can
include –

C++.

Objective-C.

Smalltalk.

Java.

C#.

VB.
The Event Driven Paradigm


Event driven programming is designed
to react to events such as user inputs,
usually mouse clicks or key presses.
This allows for more intuitive and
interactive programs to be created,
especially when programing GUIs.
EDPs also allow for easy
communication between hardware
and software.
The event driven paradigm is
generally only useful when
programming for GUIs due to it’s
interactive and reactive nature, which
renders it a fairly inflexible way of
programming.
Event Driven Programing languages
can include –

Any language can be used, but
can be made easier by using a
language that provides high level
abstractions like FOCUS, Lisp,
Perl, Python, Ruby, SAS and
COBOL.
Task 2
P2 - Describe the factors influencing the choice of programming
language.
Factors Influencing The Choice Of
Programming Language.

Reliability.

Expandability.

Suitability.

Organisational policies.

Availability of trained staff.

Development and maintenance costs.
Some Advantages And Disadvantages
Of Different Programming Language.
Some Considerations When Using Visual
Basic
Positives
Negatives

Easy to learn and understand.


Not only a language but also an
integrated IDE.
Programs created in VB only work
in Windows OS.

Requires a lot of memory to install
due to its GUI nature.

Can be downloaded for free.

Extensive online help environment.

Slower than other languages.

Includes a toolbox containing items
such as buttons etc. which have
built-in code, speeding up the
coding process.

It’s basic nature makes it
unsuitable for creating complex
programs.

Inefficient for web development.
Some Considerations When Using C++
Positives
Negatives

Free to download.


Syntax is similar to those used in
other languages e.g. Java.
Complicated language so can be
difficult to learn.

Overly complex and difficult to
debug when used for web
applications.

Mostly used for platform specific
applications.

Multi-paradigm friendly so can be
used for procedural, OOP, generic
programming, functional
programming etc.

Fast compared to others.

C++ is only 8-bit.

There is a large community of
programmers using C++ so there is
a lot of available information and
help.

Can cost money to use certain
compilers.
Some Considerations When Using
DarkBASIC
Positives

Can be downloaded for free.

Easy to learn.


Negatives

DarkBASIC costs money to use
without advertisements.
Doesn’t require as much code as
other languages e.g. C++.

BASIC languages’ syntax is unique
to BASIC only.
Designed for creating 2d and 3d
games, so excels in that area.

Is mainly focused on creating
games, so isn’t very flexible
regarding it’s functionality.

Not very fast.
Some Considerations When Using
JavaScript
Positives

Java is free.

Developed to be secure.



Negatives

Can be difficult to learn for someone with
limited experience.
Cross platform compatible.

Needs C++ to create an .exe or .app.
Quite easy to learn (compared to C++ for
example).

Slow to develop and run.

Slow compiler.
Multithreaded, allowing for the program to
perform different tasks simultaneously.

Difficult to create frame based applications.
Some Considerations When Using HTML
Positives

It is free to use.

Plain text is used so it is easy to
learn and understand.

Easy to edit because it is plain
text.

HTML is supported by (almost) all
browsers, certainly more than any
other language.

It is very search engine friendly.
Negatives

Limited security features.

It is a static language.

All pages must be edited
separately.

No dynamic capabilities when used
on its own.

Structuring can be difficult to
learn.
Task 3
P3 - Explain sequence, selection and iteration as used in computer
programming.
Sequence
An algorithm written in sequence will contain a
series of steps. When the algorithm is run these
steps will be executed in order from the first to the
last without skipping any, because there is no
method of selection and no available conditional
branches. These algorithms will run the same way
every time they are used, and will not respond to
data.
Selection
An algorithm written in sequence makes use of boolean logic,
true and false. In order for these algorithms to run there must
be procedures to handle control structures, such as the words
if, then, else, endif, switch and case. This allows for branches
in programs to be created depending on what data is being
manipulated.
Iteration
Iteration algorithms make use of loops, doing
something multiple times. Fixed loops will perform
something a set number of times every time the
program is run. Conditional loops will run until a
condition is met, for example it will run until
something becomes true or false etc. Another
example of a loop is one that will perform a specific
action whilst a condition is active, i.e. the loop will
run whist a condition is true, and will stop looping
when that condition becomes false.
Task 4
P4 - Outline the benefits of having a variety of data types available to
the programmer.
Benefits of having a variety of data types available to
the programmer.
Having a variety of different data types (such as strings, bytes, booleans, integers, dates, floating
points etc.) can be beneficial when programming for a variety of different reasons. Some of these
reasons are -

Having different data types allows you to store data without waste, making it more efficient.

Different data types have different maximum and minimum memory requirements, so data is
stored using the least amount of memory possible.

Having different data types allows code and subroutine parameters to be more expressive.

Having different data types makes it harder to make mistakes i.e. if a number (integer/floating
point) was accidently added into a line of text (string) it would produce an error. If this was not
the case it could be a lengthy process trying to find the source of an error.

Having different data types makes it easier to check for and resolve coding errors before the
code is implemented.

Having different data types allows you to write your code without having to re-implement
standard data types.
Download