Upload
hoangdan
View
238
Download
3
Embed Size (px)
Citation preview
Introduction
From this unit the learner will:
1. Know the features of programming languages
2. Understand the principles of software design
3. Be able to use tools to demonstrate software designs.
Assignment Schedule
Lesson 3 – Assignment 1 Which language? -Covers P1, P2, P3, P4
Around week 7 - Assignment 2 Design workshop- Covers P5, M1, D1
~ Week 12 – Assignment 3 Good Design!-Covers P6, M2, D2
Some useful references
Pilone & Miles, Head First Software
Development, O’Reilly Media, USA,
2008,
Anderson et. al,
Information
Technology Level 3
Book 1 pp 161 –
188, PearsonUK,
2010
https://www.codecademy.com/
Where is IT used?
List as many industries as you can where IT is used.
Football
Architect
Dairy farm
Fire and Rescue
Botanic Garden
Magazine
Car manufacturer
Chocolate factory
http://www.bbc.co.uk/programmes/b00zsc2s/clips
Problem
Firemen (farmers, footballers, car designers etc., etc ) are not programmers
Programmers are not firemen ((farmers, footballers, car designers etc., etc )
Issues caused by: Poor understanding of user need
Poor planning
This unit..
focuses on the design and development process
systems development life cycle
looks at programming concepts
examines the business context within which solutions can be developed
explores the tools that can be used to demonstrate software designs
Writing computer programs
Programmers use an IDE (Integrated Development Environment) to enter their code.
It is possible to use a text editor such as Notepad to enter your code but this is difficult and requires specialist knowledge.
Writing computer programs
Examples required in this unit
Use an IDE from Microsoft called Visual Studio 2015
Use VB.net as main programming language.
Predominantly Form based programs.
Form based programs use a GUI (graphical user interface).
Know the features of programming languages
Programming paradigms
Types of language
Reasons for choice of language
Features
Data types
Programming paradigms
Difficult to spell
Difficult to pronounce
Meaning?
Greek – paradeiknunai – to show side by side - A typical example or pattern of something; a pattern or model
Style (or different approaches) of programming
Programming
Computer = hardware + software
Hardware
So much twisted metal
Software
Firmware
Operating systems
Applications
i.e. programs
Programming
Computer reads binary (or as the computer sees it…
010000110110111101101101011100000111010101110100011001010111001000100000011100100110010101100001011001000111001100100000011000100110100101101110011000010111001001111001
Programming
Use symbolic languages with human-like statements
Different approaches – paradigms (011100000110000101110010011000010110010001101001011001110110110101110011)
Programming paradigms
a fundamental style of computer programming, a way of building the structure and elements of computer programs.
some programming languages are designed to follow only one paradigm, while others support multiple paradigms.
http://en.wikipedia.org/wiki/Programming_paradigm
E.g. Unit 16 Procedural programming
Programming Paradigms
three main types:
Procedural
Object oriented
Event Driven
Others include:
• Scripted
• Visual
Can you name a
visual programming
language?
Other languages
E.g. HTML
A mark-up language, not a true programming language.
Does not contain instructions to control the flow of the program, such as decision statements. (e.g. if..;if..else;case)
Task 1
Working in pairs – produce a set of PowerPoint slides which show examples of code written in different languages.
Extension: Try and find the same examples in the different languages.
The languages chosen must include: Python, VB.net, Javascript.
You need to include at least 5 different languages.
For each one, state the language name, example code, what the example code does and what paradigm (see below) you think applies to the language.
Possible paradigms Procedural. Event Driven. Object Orientated (OOP).
Task 1a Programming paradigms
Research the languages’ popularity and add this to the slide for each language you have chosen.
Record the source of this information.
Visual Programming
any programming language that lets you develop programs by manipulating program elements graphically rather than textually.
Task 2 Visual Programming
access scratch here:
http://scratch.mit.edu/
Make the cat walk to the right of the screen,
turn around and walk to the left of the screen then turn around and repeat.
Ext – make the cat say hello when it reaches each side, vary the speed.
Procedural Programming
a linear process where each program statement is executed line by line, one after the other.
The program can be compiled/managed or be scripted.
Some examples of procedural programming languages are :
1. C (because it comes after B) 2. Pascal (named after a French mathematician)
3. FORTRAN (formulated translation) 4. COBOL (Common Business Oriented
Language)
Procedural Programming
Advantages –
Good for general programming.
Can be scripted.
Good level of control, can be multi-platform.
Has a Portable Source Code.
Disadvantages:
There are a lot of procedural languages, and you cannot learn them all, usually you learn one well.
Large programs can run very slowly.
Need to develop in a methodical way and test frequently.
Testing can be slow as all processes need to be re-tested each time even though they have been proven to work.
Object Oriented Paradigm (OOP)
a programming model organized around:
objects rather than "actions" and
data rather than logic.
It uses the system of classes and objects, a class may hold many objects
Examples: C++, C#, Python, vb.net, Java
Basic OOP
Objects have to be instantiated (Created) using designs (Classes) .
Objects encapsulate the data and functions (methods) needed to manage the data.
The designs (classes) take the most time to create.
They offer great flexibility in program development and maintenance.
Basic OOP
Created in the 1980’s
Breaks the task into modules called classes
Classes are easier to modify
Improved security of data (hidden data)
Easy to add functions (classes)
Follows a bottom-up approach
Object Oriented Paradigm
Advantages:
Has a clear structure good for defining data types
easy to maintain and modify existing code new objects can be added by copying and slightly changing
previous code allows faster development.
Low cost due to reusing code
Disadvantages:
Complex thought process difficult for some people to learn / get used to.
Large Program size slower as more instructions must be executed.
Event Driven Programming Paradigms
for example, an object is clicked on and it triggers an event.
used for things like renting out cars
a GUI would be used
when the user clicked on a button an event would be triggered detailing which cars were still available to rent
Examples: C, C++, C#
Event Driven Programming Paradigms
Advantages: Flexibility Used a lot with modern GUI programs allows for more interactive programs. Disadvantages: A mixture of object oriented and procedural
programming – similar limitations Requires large amount of processing power An extra layer of complexity Less easy to follow the logic
TOOLS
CLI – Command Line Interface.
In the past all programs were written using a CLI, one line at a time!.
IDE – Integrated Development Environment.
Most programs are now written using an IDE, VS201x, Eclipse, PyCharm, PHPStorm etc.
CASE – Computer Aided Software Engineering.
Integrated Development Environment
Everything needed to write a program
Editor – for writing instructions
Additional tools e.g. pop-up help
Compiler – converts program to machine code
Windows forms editor
Creates Windows forms and controls (buttons, text boxes, check boxes etc)
Debugger
CASE tools
Computer Aided Software Engineering
Used in large software development projects
Automates parts of the process
Assists in creation of design diagrams
Structure charts
Data flow diagrams (DFDs)
Entity relationship models (ERMs)
Programming generations
1842
calculation
of
Bernoulli
numbers
Ada
Lovelace
1940s
Great deal
of effort,
Error-
prone
Programming generations
High-level languages use notation which is more familiar to
humans: mathematical or spoken/written language.
Task 3
Using the slides created in task 1 –
Research each language in your slides and add the generation of languages they belong to:
1gl,
2gl,
3gl,
4gl,
5gl
Homework: - submit to TurnitinL3U06H1PeterPan2016
Prepare a presentation, including speaker notes, to explain to trainees the typical applications for the major programming paradigms. Give examples of the types of program that each paradigm should be used to write. Describe the limitations of each paradigm.
Include the following paradigms:
Procedural
Object-oriented
Event-driven