Transcript Slide 1

[email protected]
1
Languages
Languages for IT & CS
Pseudo-code
What HTML isn’t
Early history
Compiling & interpreting
Classifying languages
The process of programming
Programming tools
Bugs
Languages in IT and CS




English …
Pseudo-code
Programming languages
Other formalised languages
[email protected]
3
Languages
Languages for IT & CS
Pseudo-code
What HTML isn’t
Early history
Compiling & interpreting
Classifying languages
The process of programming
Programming tools
Bugs
Pseudo-code
 A half-way point between the way in which
we would describe the steps in a algorithm
to another person and the way in which
one would write them in a specific
programming language to be run on a
computer
5
Pseudo-code
 Doesn't relate to any specific programming
language
 More formal than natural human language,
less formal than something written in a
programming language
 You’ll be familiar with flow charts
6
Languages
Languages for IT & CS
Pseudo-code
What HTML isn’t
Early history
Compiling & interpreting
Classifying languages
The process of programming
Programming tools
Bugs
Not all computer languages are
programming languages
 Programming
languages
–
–
–
–
–
VB
Javascript
Java
VBScript
XSLT
 NOT programming
languages
– HTML
– XHTML
– XML
– UML
8
Languages
Languages for IT & CS
Pseudo-code
What HTML isn’t
Early history
Compiling & interpreting
Classifying languages
The process of programming
Programming tools
Bugs
A early history of computing
languages
 Machine code
– completely consists of binary,
– is the computer code that machines actually execute
– hard for humans to read, write and understand
(even when its converted to hex)
 Assembler – designed so that humans have
some guides to understanding – gets changed
into the actual code that is run on the computers
 Early higher order languages (eg FORTRAN,
COBOL, BASIC, Lisp)
10
The translation from high-level
language to machine instructions.
Programs in a standard
programming language
(C, C#, Java, VB.Net
Total=princ+interest
Compile
Programs in assembly language
ADD 20, 20, 24
Assemble
Programs in binary
00100100
00101001
01110101
00110101
11
Languages
Languages for IT & CS
Pseudo-code
What HTML isn’t
Early history
Compiling & interpreting
Classifying languages
The process of programming
Programming tools
Bugs
Compiling
 Many computing languages are complied in
versions that can be run on computers –
languages such as C++, Java (most languages
that are used for writing applications are
compiled)
 Other computing languages are interpreted. The
machine code is generated by an interpreter at
the time that they are run. Most scripting
languages are of this sort – eg. JavaScript and
VBScript
13
Compiling and Interpreting
 Not all computing languages are compiled.
Some are interpreted
 In interpreted languages, the source code
is always present and it when it is run it is
interpreted line-by-line and then it is
executed. Most scripting languages are of
this sort – eg. JavaScript and VBScript
14
Languages
Languages for IT & CS
Pseudo-code
What HTML isn’t
Early history
Compiling & interpreting
Classifying languages
The process of programming
Programming tools
Bugs
Classifying computer languages




Syntax
Paradigm
Common uses
Relationship to with the lower-level
software and hardware
16
Syntax
 There are families of languages that have
the same or nearly the same syntax
 JavaScript's syntax is very like the syntax
of C, C++, C#, Java ...
 VB.Net's syntax is very like the syntax of
Basic, VBScript ...
17
Different types of computer
languages – different paradigms
 Procedural programming languages (eg: C
and Basic)
 Functional languages (eg: Lisp, Haskell)
 Object-oriented languages (eg C++,
Smalltalk, Java, VisualBasic.Net)
 Scripting languages (JavaScript, Perl,
VBScript)
 Declarative languages (Prolog)
18
 Object-oriented programming
– Examples C++, Java
– Hopes to parallel ways we think about and
analyse problems
19
Scripting languages
 Examples: javascript
perl, VBScript, php, …
 Usually interpreted rather than compiled
 Usually "weakly typed"
 Relatively quick to write – often used for small
jobs
You write a script to handle.
 Many of them are especially designed for certain
purposes (javascript, php and to some extent
perl
20
Different types of computer
languages – different paradigms
 Procedural programming languages (eg: C
and Basic)
 Functional languages (eg: Lisp, Haskell)
 Object-oriented languages (eg C++,
Smalltalk, Java, VB.Net)
 Scripting languages (JavaScript, Perl,
VBScript)
 Declarative languages (Prolog)
21
Common uses
 Scripting languages (Javascript, VBScript,
perl, php)
 Application languages
 Text manipulation (perl)
22
FAQ




Why are there so many?
Do I need to learn them all?
Which ones are important for me to learn?
How are they different?
23
Languages
Languages for IT & CS
Pseudo-code
What HTML isn’t
Early history
Compiling & interpreting
Classifying languages
The process of programming
Programming tools
Bugs
Things we do when programming
Running tests
Gathering specifications
Writing tests
Finding problems with the code
Writing code
Interpreting specifications
Adding functionality
Fixing problems with the code
25
Languages
Languages for IT & CS
Pseudo-code
What HTML isn’t
Early history
Compiling & interpreting
Classifying languages
The process of programming
Programming tools
Bugs
Tools
 To understand what we need to build
 To create software
IDEs
Text editors
 To test software
unit test tools
 To debug software - debuggers
27
IDEs
 Visual Studio
 BlueJ
 Excel (?)
28
Tools
 Write – IDEs
 Test – IDEs
debuggers
 Design and analyse –
UML
 IDEs are software
applications
 UML – (the unified
modelling language)
helps people design
software and
communicate their
designs
29
An IDE
30
A text editor
Syntax
highlighting
!
31
The cycle for writing code
 Write some code
('edit')
 Compile the code
 Run the code
Repeat
32
A tool – UML ("the Unified
Modelling language")
 Class diagrams are a
simple and useful way
of expressing
relationships between
parts of our program
in an object-oriented
language.
33
Languages
Languages for IT & CS
Pseudo-code
What HTML isn’t
Early history
Compiling & interpreting
Classifying languages
The process of programming
Programming tools
Bugs
All the code we write has bugs
 'All'
'Well, ...'
 Bugs are not good!
35
Harvard Mark II –
the 1st bug
36
What to do when you find a bug
 Apply the debugging strategy:
– Reproduce the error, understand the problem, check
the obvious causes
– If this does not solve the problem, press on
– Try to isolate the problem
– Think through the probable process
37
Programming languages
 Similiarities – help us to learn other ones
– Syntax
– Purpose
– Paradigm
 There are different programming
languages for different purposes –
different strengths and weaknesses
38
Things we do when programming
Running tests
Gathering specifications
Writing tests
Finding problems with the code
Writing code
Interpreting specifications
Is there
any
special
order
here?
Adding functionality
Fixing problems with the code
39
Terminology you should know
 IDE – Integrated programming
environment
 Scripting language
 Pseudo-code
 Machine code
 Syntax
[email protected]
40
Exam questions (2009 – CO332)
What is an IDE and what does it do? Give
an example of an IDE. [2 marks]
Draw a flow diagram or write in pseudo-code
an algorithm for alphabetising a collection
of CDs. [4 marks]
[email protected]
41
[email protected]
42