What is Functional Programming?
Functional programming uses a series of function definitions which are evaluated as a mathematical expression to solve a problem.
Functional programming is a declarative language.
Functional programming is used in research and testing.
An example of a logic programming language is Lisp, Python .
Advantages -
Easily testable code
Use of modules that can be used throughout
What is Logical Programming?
Logical programming is used to solve programming problems using a specific knowledge base.
Logic programming takes a problem or question and will produce a solution based on this knowledge base.
Logic programming is used in expert systems, machine learning and artificial intelligence.
This would be known as a non-procedural language
An example of a logic programming language is PROLOG .
Advantages -
Ideal for expressing complex ideas and algorithms
Code will run more efficiently when implemented properly
Helps with readability of code
What is a scripting language?
a set of commands understood by the application software
A scripting language ( is often embedded in other languages and) can add functionality to web pages
Different software usually have different script languages and the scripts cannot always be used with other programs
These are usually embedded in another language and is used to control aspects of the software (and is a high-level language, i.e. interpreted not compiled)
What is Procedural Programming?
Procedural languages are used to carry out action and calculations with an ordered set of instructions.
Code is divided into function
Focus is placed on the functions
Procedures contain a sequence of instructions that are executed sequentially step-by-step
Advantages -
Supports a logical set-by-step process
Allows the programmer to define precisely each step when perofrming a task
Provides close control over the underlying operation of the hardware
Enables similar operations may be carried out at varying stages of program execution
What is special purpose Programming language?
used for problems such as expert systems, simulation or artificial intelligence
Programmed to solve a particular problem
Inheritance enables new objects to take on the properties of existing objects.
A superclass is used as the basis for interitance. A class that inherits from a superclass is called a subclass.
Inheritance defines relationships between classes and organises classes into groups.
Inheritance enables classes that are similar to existing classes to be created by indicating differences (rather than starting again) and thereby allows code to be organised and re-used effectively.
As well as inheritance there are other fundamental concepts of object-orientated programming
Abstraction - a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency.
Encapsulation -a process of wrapping similar code in one place.
Polymorphism - that allows a specific routine to use variables of different types at different times. It gives a program the ability to redefine methods for derived classes.
Object hierarchy - It references descendants of objects acting as properties of an object. An example of this would be the object controlling a window (at the top of the hierarchy) having another object like the window's border acting as a property of the window.
Method - program or routine defined within the class/contained within the object
Class - template specifying methods/properties
What is the need for standardisation of computer languages?
When hardware or software is developed it needs to ensure it is compatible with existing hardware and software
Products developed by different companies need to meet standards to ensure combability acorss platforms
There must be interoperability between new products and with existing products to exchange and use data
Using standard ensures products can work as part of larger systems or networks
Examples
HTML5
CCS3
Javascript (all maintained by World Wide Web Consortium)
A natural language interface is where speech and linguistics is used to interact and control a software application
Use
Translation software - process in real time to allow for a seamless translation service
Problems
Colloquialisms and words can be interpreted differently regionally.
Accents could make it difficult for a natural language interface to identify the words being spoken
Ambiguity in spoken language where a word may have more then one interpretation
Background noise could cause problems
Illness such as sore throat
The purpose of Backus-Naur Form or the reason it is used is to describe (unambiguously) the syntax/grammar/rules of a programming language as natural languages such as English or Welsh are normally ambiguous and imprecise
Example of a Syntax diagram
This represents a word has to be three or more characters
WJEC Jun 2018
WJEC Jun 2017
WJEC Specimen