AND SOFTWARE DESIGN
UNIT 6 - Assignment 1
,Unit 6 – Assignment 1 Principles of Programming and Software Design
Contents
What is a computer program?...............................................................................................................3
What is a programming paradigm?.......................................................................................................3
Procedural Programming...................................................................................................................3
Use.................................................................................................................................................3
Limitations.....................................................................................................................................3
Object Oriented.................................................................................................................................3
Use.................................................................................................................................................4
Limitations.....................................................................................................................................4
Event Driven......................................................................................................................................4
Use.................................................................................................................................................4
Limitations.....................................................................................................................................4
Supporting tools and environments..................................................................................................4
Use.................................................................................................................................................4
Limitations.....................................................................................................................................4
Different types of languages..............................................................................................................5
Visual languages............................................................................................................................5
Mark-up languages........................................................................................................................5
Script languages.............................................................................................................................5
Choosing a new language......................................................................................................................6
Organisational Policy.........................................................................................................................6
Suitability and features of tools.........................................................................................................6
Availability of trained staff.................................................................................................................6
Reliability...........................................................................................................................................6
Development and maintenance costs...............................................................................................7
Expandability.....................................................................................................................................7
Sequence, Selection and Iteration.........................................................................................................8
Sequence...........................................................................................................................................8
Selection............................................................................................................................................9
Iteration...........................................................................................................................................10
Data Types...........................................................................................................................................11
Different Data Types........................................................................................................................11
Importance of choosing the right data type....................................................................................11
Benefits of having multiple data types............................................................................................11
Stage 1: Determining the scope of the problem..................................................................................12
1
,Unit 6 – Assignment 1 Principles of Programming and Software Design
Stage 2: Gathering requirements.........................................................................................................12
Stage 3: Writing the specification........................................................................................................12
Stage 4: Designing a solution...............................................................................................................13
Stage 5: Coding the design...................................................................................................................13
Stage 6: Testing the program code......................................................................................................13
Stage 7: Writing documentation..........................................................................................................13
Stage 8: Reviewing and maintaining the solution................................................................................14
Software structures, readability and quality........................................................................................14
Software structures.............................................................................................................................14
Procedures.......................................................................................................................................14
Functions.........................................................................................................................................14
Objects and classes..........................................................................................................................15
Pre-defined code.............................................................................................................................15
Quality.................................................................................................................................................16
Portability........................................................................................................................................16
Efficiency..........................................................................................................................................16
Accuracy..........................................................................................................................................16
Reliability and robustness................................................................................................................16
Usability...........................................................................................................................................16
Maintainability.................................................................................................................................16
Readability...........................................................................................................................................17
Commenting code............................................................................................................................17
Variable names................................................................................................................................17
Indentation......................................................................................................................................17
2
, Unit 6 – Assignment 1 Principles of Programming and Software Design
Section 1 - Programming
Paradigms and Types of
Languages
What is a computer program?
A computer program is a series of instructions that runs a task when executed by the computer. A
program is required for a computer to operate properly.
What is a programming paradigm?
A programming paradigm is a classification of a programming language that is determined by its
features and characteristics.
Procedural Programming
Procedural programming languages were first used in the 1960’s. A procedural programming
language relies on the user providing a series of instructions that the computer follows to conclude a
final answer. Some common procedural languages are: BASIC, Pascal and C. BASIC was the preferred
language to be used during the 1970s and 80s and relied on the use of line numbers. Pascal was first
created in 1970 by Niklaus Wirth and, even though it is over 30 years old, is still widely used today in
schools and colleges because of its ability to encourage a structured approach to problem solving. C
was developed in 1972 by Dennis Ritchie and relies on the use of symbols instead of keywords
therefore making people view it as harder to learn, however, this allows it to close with better
answers in a smaller number of lines.
Use
Procedural programming is mainly when solving problems therefore the programmer would have to
create an algorithm that a program then executes to find a final answer. In concept, procedural
programming is easier to learn so is often used when someone is developing their first program.
Limitations
Because of its simplicity, procedural programming is harder to use when creating complex programs.
For example, a common limitation that people run into when using procedural languages is
“Spaghetti-code”, this is code that has become difficult to follow due to it being adjusted so many
times. Furthermore, every line of code is attached to another and is not independent therefore
arising problems when or if a line of code is removed.
Object Oriented
Object oriented programming has been used since the late 1960s, however, it became a more widely
used paradigm in the 1980s and is still commonly used today. Some popular object oriented
languages are: C++, Microsoft C#, Sun Java and Microsoft Visual Basic.NET. Object oriented
programming involves a programmer examining a problem and breaking it down into multiple
elements called “classes” instead of writing an algorithm. Furthermore, the programmer would
create objects using the process of instantiation which entails making a solid instance from a class.
3