Computer Language Flashcards
Text based Interfaces
User types in commands as a series of words or abbreviations. All commands can be carried out using the keyboard. Characters and control keys (arrows, Return, Tab, etc)
Text based Interfaces - Use
Setting up a BIOS
Older business software e.g. accounts packages.
Text based Interfaces - Advantages
- Simple and accurate.
- Little processing power needed.
Text based Interfaces - Disadvantages
- Needs Keyboard
- Need to know commands in advance.
Forms Dialogue
Interaction is through a series of forms that are used to enter data and display results.
Many inputs may use drop down boxes, radio buttons and check boxes.
Forms Dialogue - Use
Setting configuration .
Forms Dialogue - Advantages
Familiar to paper forms, which might be familiar with.
Forms Dialogue - Disadvantages
May be restrictive.
Graphical User Interfaces (GUI)
Combination of windows, menus, icons and a pointer. (WIMP)
Graphical User Interfaces (GUI) - Benefits
(USUALLY)
- Easier to learn for novice.
- More intuitive to use once learned.
- Allows customization (desk-top, creating shortcuts).
- Similar to other packages with which users are familiar.
- No need to learn complex text commands
- Has good help systems, tutorials, wizards, etc.
Graphical User Interfaces (GUI) - Disadvantages
- Requires a lot of processing power.
- Requires hard disk space.
Dedicated Keys
A specific key or button has a function associated with it. May also refer to a key combination eg C for copy.
USE: As control buttons for devices with embedded computers eg cameras.
Soft Keys
Keys that can be programmed to perform specific functions.
USE: allocating frequently performed tasks to the function key on a keyboard.
Voice Synthesis - Use
- Automated announcements e.g. on board trains - will not be forgotten.
- Used with automated phone systems.
Voice Synthesis - Advantages
- Useful for blind, e.g. reading machine.
- useful when screen can not be used e.g satellite navigation systems.
Voice Synthesis - Disadvantage
- May sound very artificial, lacks expression.
- No use in noisy environments.
- No use for deaf.
Speech recognition
Device recognizes spoken words.
Speech recognition - Benefits
- Speeds up text input/ faster then typing.
- May help to avoid RSI.
- Hands free, user can do other tasks at the same time.
Speech recognition - Problems
- The System can’t tell the difference between homophones.
- The system can get confused between commands and dictation.
Handwriting Recognition
User uses a pad and writes as if with a pen on paper. Computer recognizes the characters written as if they were typed.
Handwriting Recognition - Benefits
It’s easier/faster for users than typing.
It’s more “natural” form of input.
Avoids use of bulky keyboard.
Design validation
Does it meet requirements?
Have the appropriate techniques been used? - Methods of implementation, hardware.
Is the user interface acceptable?
Feedback from prototypes
Design evaluation
Can the design be implemented with given resources?
Can the design be completed on time?
Is the design as simple as possible?
Can the design be completed within the given budget?
Algorithm
An algorithm is a sequence of steps designed to perform a particular task.
Types of algorithms
-Structured English.
-Pseudo code.
Flowchart.
Machine language
Instructions represented by patters of bits that the processor in a computer can understand.
What is Assembly Language?
Assembly Language is an abbreviation of machine language.
Semantics
The rules which govern the meaning of a word or phrase.
Syntax
The rules which govern the way in which words can be put together.
Language Levels
Computer languages are classified according to the way in which they interact with the hardware.
Low Level Languages: FEATURES
- Few data structures.
- Are concerned largely with operating on bits.
- Commands cover only simple operations such as shifts, additions, and transfer memory to a register.
- Commands interact directly with the hardware.
- Programs are difficult to transfer to different types of computer.
High Level Languages: FEATURES
- Commands are very similar to “English” therefore it’s easier to understand.
- Commands are more powerful than in a low level language.
- There are a variety of data structures available e.g. strings, arrays, records.
- If there are errors the translation process will identify many of them.
- The commands do not refer to hardware directly so they are easier to transfer from one type of machine to another.
Use low level language when
- Control of hardware directly is needed.
- maximum performance is needed.
- Resulting program can be very small.
Use high level language when
- Allow portability.
- Easier to write in.
- Whenever possible.
Procedural Programming (Imperative Languages)
Languages where a series of command loops, decisions and calculations are carried out in sequence.
Procedural Languages
Procedural languages are to do with actions, calculations and following a set of instructions. They are used for most programming tasks.
Sequence
Carry out each instruction in turn.
Repitition
Loops are used to allow instructions to be repeated.
Selection
If/case statements are used to allow decisions to be made.
Recursion
A recursive subroutine is one that calls itself; there will be a recursive part and a non recursive part (base case).
Non Procedural Languages (Declarative languages/ logical programming)
Non procedural languages are concerned with facts, rules and queries.
Object orientated
Object orientated languages are when where the problem is broken down into a series of classes. Each class describes an object that has both data and methods (actions).
Encapsulation
The idea of having a class that describes data and methods of an object.
Polymorphism
Several methods can have the same name provided they differ in their parameters.
Inheritance
A class might be based on and extend an existing class so only the differences have to be programmed.
Special purpose language
A special purpose language will have features that are relevant to a particular application such as simulation or control.
Example: SQL and HTML
Visual language.
Many languages have tools that allow a GUI to be designed visually for an event driven environment. The tool then writes the program (Code Generation) to create the GUI.
Application Languages
An application language is a language built into an application so that addition features can be added through program code.
4GL
A 4GL is a high level language that allows data to be queried & manipulated. Applications to be produced with little programming experience.
Scripting languages
A scripting languages is a high-level programming language that is interpreted not compiled and often embedded in other languages e.g. to add functionality to a web page.
Standardising a Language: What is it?
Standardizing a language makes it easier to move a program from one computer to another (portable). Standardizing is a slow/complex process and some claim inhibits innovation.
Natural Language
Human Languages. They tend to be ambiguous (would have multiple meanings) so are not good for controlling a computer.
Nested Loops
When a loop accrues in another loop.
When is recursion used:
- Quick sort.
- Tree processing.
- Binary search.
…
Global Variable
A global variable exists throughout the program (class).
Local Variable
A local variable only exists in a part of a program or class.
Parameter
A parameter is a variable that is local to a method that it use to pass data into or out of a method.
Advantages of libraries
- Code is re-usable.
- Reduces development time.
- Generally written by experts.
- Already tested, reduces testing time.
Parallel Processing
The simultaneous use of several processors/cores to perform a single task.
Parallel Processing used for:
Extremely large/complicated calculation is being carried out.
For example: weather forecasting, image processing.
Libraries
A (subprogram) library is a set of prewritten modules/sections of code to carry out a particular task.
Advantages of Libraries
- Code is re-usable.
- Reduces development time.
- Generally written by experts.
- Already tested, reduces testing time.
Syntax Diagrams
Syntax diagram show the legal syntax of the program (but not the semantics) and are mainly used by programmers as a quick reference.
BNF
Backus Naur Form is a language for defining the syntax of a program language. Such languages are known as meta languages.
::= |
Weaknesses of interpreted languages
- Slower execution - translating as it runs
- Source code and interpreter are both needed to run the program.
- Errors are not detected until that line is executed.
Advantages of interpreted languages
- Larger systems compilation can be slower, makes program development slow.
- Scripting languages can be translated into machine code for computer they are on.
Linker (Linkage Editor)
Linker (Linkage Editor) The link editor joins the separate pieces of machine code that form the program with library code to produce a single executable program.
Loader
The loader is part of the operating system that transfers an executable program from disc into memory ready for execution. The OS decides on the address to be used.
Relocatable code
Relocatable code is (machine) code which will work correctly from wherever the OS decides to load the code into memory.
Translation Program
A translation program coverts the source code/high level code into low level code/machine code ready for execution by the computer.
Compilation Steps
- Lexical Analysis.
- Syntax analysis.
- Semantic analysis.
- Code optimization.
- Code generation.
Compilation Steps: Lexical analysis
- Breaks up the source program into words and other symbols (called tokens).
- finds word boundaries by looking … for delimiters (spaces etc)
- Removes comments and excess spaces.
- Programmer defined terms are added to symbol table.
Compilation Steps: Syntax analysis
- Checks that rules of language are met (from a BNF type definition)
- Produces syntax error message if rules are broken.
Compilation Steps: Semantic analysis
- Checks that variables are declared
- Checks data type for variables
- Checks data type for parameter.
Compilation Steps: Code Optimization
- Removes instructions that have no affect.
- Makes sure that frequently used variable are stored in register.
Compilation Steps: Code Generation
- Produces the machine code equivalent program.
- Substitutes sections of machine code to replace high level instructions
- Loops and decisions are replaced by branches
- Identifiers are replaced by their addresses.
Syntax error
Errors produced which don’t comply with the programming language standards.
Example:
string x;
string y;
x = 4*y;
Error produced since a string can’t be multiplied.
Pre run errors (Linking errors)
Errors may be generated by the linked or loaded if for example a required library is not present (or in the wrong version)
Run time errors
- Divide by zero
- Overflow
Logic errors
These errors that do not stop execution but they do mean that the program does not produce the desired outcome.
CASE Tools
Computer Aided Software Engineering, it refers to any application that takes description of a problems and generates code.
Advantage of CASE tool
CASE tools reduce the development time and reduces the number of errors in the code.
Debugging Tools
A debugger is used to help to track down logical and run time errors.
Debugger: Breakpoints
A breakpoints marks an instruction in the program. The program will execute as normal until the breakpoints is reached’ it will then stop and allow variable to be examined.
Debugger: Trace
A trace facility records the order in which lines of a program are executed. This may be sent to a printer of a file for later analysis. It may allow the programmer to step through the instructions one at a time and values of variables observed.
Debugger: Variable watch
Selected variables and their values can be displayed as the program runs. using this is possible to see what actions cause a variable to change.
Debugger: Store dumps
This is a copy of all the variables and their values. It can be set up to happen when a particular instruction is reached. it is normally sent to a printer or a file for later analysis.
Error diagnostics
The run time system with many languages will produce error message when run time error occurs. E.g.
Null pointer at line 458
Overflow at line 326
These helps identify the nature of any run time error.
Speech recognition: USE
To control a device (voice commands).
To replace the keyboard for the entry of large amounts of text (dictation).
For use with automated phone systems (bank balance enquirers).
Handwriting recognition: USE
As an alternative to the keyboard.
Might be used on a hand held computer.
Used on Interactive White Boards.