Software development languages and environments
This presentation is the property of its rightful owner.
Sponsored Links
1 / 21

Software Development Languages and Environments PowerPoint PPT Presentation


  • 91 Views
  • Uploaded on
  • Presentation posted in: General

Software Development Languages and Environments. Programming languages. High level languages. are problem orientated contain many English words are easier to understand must be translated into machine code are designed to solve particular types of problems.

Download Presentation

Software Development Languages and Environments

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Software development languages and environments

Software Development Languages and Environments


Programming languages

Programming languages

High level languages

  • are problem orientated

  • contain many English words

  • are easier to understand

  • must be translated into machine code

  • are designed to solve particular types of problems


Classification of programming languages

Classification of Programming Languages

Lots of way’s to classify languages

  • Higher Computing examines four

    • Procedural

    • Event Driven

    • Declarative

    • Scripting

  • There are many, many more you don’t need to worry about just now for example

    • Object Orientated

    • Page Description Languages

    • Parallel


Procedural languages

Key features

Carried out in a fixed sequence with a start and end point

Can be split into separate functions and procedures

Have control structures such as If statements, for..next loops and do..while loops

Examples of procedural languages are:

BASIC

Pascal

C

A lot of programmers are familiar with at least one procedural language

Procedural Languages


Example pascal procedural code

Example Pascal Procedural Code


Declarative languages

Key features

Consist of facts and rules

No fixed sequence of instructions

Are queried (asked questions) which they try to find a solution to

Uses pattern matching to answer queries

facts and rules combined in different ways until a solution, or no solution, is found

Examples of declarative languages are:

Prolog

LISP

ML

Scheme

Erlang

languages such as Prolog and LISP are used predominantly in the field of Artificial Intelligence.

Declarative Languages


Example prolog declarative code

Example Prolog Declarative Code

Here are some facts:

Parent (Liz, Tom). means that Liz is a parent of Tom

Female (Liz). means that Liz is female

Male(Tom).

Parent(Bert, Tom).

Here is a rule:

Mother(X, Y) :- means that X is a mother of Y IF

Parent(X, Y), Female(X) X is a parent of Y AND X is female!

Query could be Mother(X, Tom) which would give the answer X=Liz


Event driven languages

Key Features

no fixed order of instructions

wait for user input (clicking a button) before performing an action

front end for creating graphical user interfaces

share the same type of language features as procedural languages

Examples of event driven languages are:

Visual Basic

Delphi (Object Pascal)

Smalltalk

Used for creating a wide range of desktop applications for modern OS’s such as Mac OSX and Windows Vista

Event Driven Languages


Example visual basic event driven code

Example Visual Basic Event Driven Code


Scripting languages

Key Features

usually built-in to existing applications

automate or extend the functionality of applications

have extra functions, procedures and data types related to the application

Selection.Font.Name

Range(“A1”).Select

run slower than other programs because they’re interpreted

share the same type of language features as procedural languages

Examples of scripting languages are:

VBA (Visual Basic for Applications)

Javascript

TCL

Lots of people create and use macros who wouldn’t consider themselves programmers

Scripting Languages


Choosing an appropriate language

Choosing an appropriate language

  • the experience and expertise of the development team

  • the languages available to the organisation

  • which language has the facilities most appropriate to solve the problem

  • the availability of a suitable complier/interpreter

  • the portability of the code produced


Identifying what language features are needed

During the Design Phase

Identify objects and operations needed for the new program

This allows the developer to choose a language during the implementation phase that has appropriate features

Example

A mail order application would have the following objects

Orders, Receipts, Customer Details

And operations

Add new customer, fill out order, create receipt

An event-driven language might be the most appropriate language type to use in this case

Identifying what language features are needed


Example vba scripting code

Example VBA Scripting Code


High level language translators compiler

High Level Language Translators - Compiler

Compiler

Source program

Machine code object program

Errors

and diagnostics

Compiler stops


High level language translators interpreter

High Level Language Translators - Interpreter

Machine code instruction performed

Machine code

Program statement

Interpreter

Errors

and diagnostics

Interpreter stops


The translation high level languages

The Translation High Level Languages

Relative Advantages of Interpreters & Compilers

  • The main difference between an interpreter and a compiler is that a compiler generates a complete machine code program only once and this program can be saved and run.

  • The interpreter on the other hand needs to analyse and interpret the same program statements each time it meets them this can be wasteful when processing a loop.


The translation high level languages1

The Translation High Level Languages

Relative Advantages of Interpreters & Compilers

Errors:

  • When the interpreter encounters an error it reports this to the user immediately and halts further execution of the program.

    Such instant feedback, pinpointing the exact location of the error, helps the programmer to find and remove errors.

    This makes the interpreter the preferred translator at the implementation stage

  • Compilers, on the other hand, analyse the entire program, taking note of where errors have occurred, and places these in an error/diagnostic file. If errors have occurred then the program cannot run. Programmers must then use the error messages to identify and remove the errors in the source code.


The translation high level languages2

The Translation High Level Languages

Relative Advantages of Interpreters & Compilers

Speed:

  • An important difference is that interpreters can be 2 to 10 times slower than compilers. One reason for this is that they translate the same statements within a loopover and over again.

  • Compilers can produce much more efficient object code than interpreters thus making the compiled programs to run faster.


The translation high level languages3

The Translation High Level Languages

Relative Advantages of Interpreters & Compilers

Ease of use:

  • Interpreters are more suitable for beginners to programming since errors are immediately displayed, corrected by the user, until the program is able to be executed.

  • On the whole compilers tend to be more difficult to use.


Macros

Benefits of Macros

Can extend and add new features to a program that the developers didn’t think of

Can simplify and repeat complex or frequently used commands

Can be assigned to a keyboard shortcut to make it easier to use when required

Creating a Macro

Record a series of actions in an application you are using

Code gets generated and saved as a program script

Script can then be assigned to a keystroke

Or

Write and save the script in an editor

Run the script in the application and find and fix any errors

Script can then be assigned to a keystroke

Macros


Example exam questions

Example Exam Questions

  • Describe two characteristics of a scripting language not commonly found in a procedural language (2)

  • A program contains the following statement:

    Is_a(rover, dog).

    State which type of programming language is being used. (1)

  • State two benefits of using a macro to create an alphabetical list of customers whose account balance is over £5000. (2)

  • Macros are written in a high level language. State the type of high level language that is used to write macros. (1)

  • State two features of a declarative programming language (2)

  • State two methods of creating a macro (2)


  • Login