ndu06 typesof language
DESCRIPTION
TRANSCRIPT
ND Unit 06
Types of Programming Language
This session will cover:
Procedural languages Object-orientated programming Visual languages Mark-up languages Scripting languages
To Pass assignment 1 you must describe 4 different types of language [P1]
Procedural Languages
Early Windows programs used these The program controls what happens
not the user The task is completed based on user
input Tasks are broken into a number of
stages known as procedures or subroutines
Procedural Languages
Each procedure does a specific part of the task
For example a procedure might open a file, read in a number or multiply 2 numbers
Examples are C, Fortran, Pascal, and Basic
Object-orientated programming (OOP)
Is relatively new and not used until the 1990’s when programs got more complex
The program is broken down into objects, not lists of instructions
Each object can perform tasks and communicate with other objects
The object can be thought of as a small machine with a set job
Object-orientated Example
A company’s personnel records program would have an employee object
The employee object would have features such as Forename Surname and date of birth – we call these attributes
The object would also have actions such as join company, leave company, change details – we call these methods
Object-orientated programming (OOP)
Unlike procedural programming, the programmer does not need to know the code which is ‘behind’ each object making it work
They only need to know the attributes and methods of each object and how to make it interact with other objects
They then use the objects as ‘building blocks’ to make the program do what they want it to
Examples languages capable of OO are Java, C# and VB.NET
Visual Programming Languages
These are used to create software which has a graphical user interface (GUI), such as Windows programs
VP languages have procedural features but also have OO capabilities
Examples of VP languages are Visual Basic.NET and Visual C++
Visual Programming Languages
VP design has 2 stages First the programmer
designs the GUI, placing objects such as textboxes, buttons and labels onto a form
Then they write the code which gives the functionality to the program
Markup Languages
A markup language combines text and extra information about the text
This extra information is in the form of tags
Tags control the structure or presentation of the text – should it be large or small font, blue, green, bold or underlined?
The programmer can also insert images, hyperlinks and tables into the text using tags
Markup Languages The best-known markup example is
Hypertext Markup Language (HTML), used on the World Wide Web
Example: <title>Home Page</title> <style type="text/css" media="screen"> @import "stylesheets/public.css"; body { background-color: white }; </style> Another example is XML (Extensible
Markup Language) which allows users to write their own tags
Scripting languages
Scripting languages can be typed in directly from a keyboard
Some are used to execute a series of commands that would otherwise have to be typed in via a keyboard / mouse
These can be used to control the operating system and are known as a shell script language
Examples are VBScript and Windows Powershell
Scripting languages
Others allow users to write short, simple, programs
Often the language used is specific to each application such as the macro languages used in Access or Excel
Script can also be used to write functions that are included in HTML pages to do tasks which can’t be done with HTML alone
An example of this is JavaScript
Which language to use depends on:
Organisational policy – your company may be ‘tied’ to Microsoft or Macintosh
Will it work on the hardware already used? Does it do what we need it to? Are current staff trained in its use? Is it reliable? Important for safety-critical
systems! Costs of developing and maintaining
programs Will it be expandable in future?