High-level+Language+Programming+Paradigms

=High Level Programming Paradigms=

Declarative Languages
Languages such as BASIC, C++ and Java are //procedural// languages. That is to say we tell the computer, step by step, what we want it to do. With a //declarative// language we tell the computer what we want it to find out but not //how// to get there.

A declarative language uses //facts// and //rules//.

A fact is a statement that is true. In the declarative language Prolog facts look like this: code girl(jane). code //i.e. Jane is a girl.//

code dog(scooby). code //i.e. Scooby is a dog.//

A rule gives us a set of conditions for something to be true. In Prolog rules look like this: code mother(x,y):- female(x), child(y,x). code

//This means x is the mother of y if x is female and y is the child of x.//

Object Oriented Programming
With software becoming increasingly complex, a programming paradigm was developed to fit alongside more traditional programming. Object Oriented Programming (OOP) organises its code into classes. Multiple objects can then be derived from these classes quickly and easily. OOP is based on key concepts of inheritance and encapsulation (hiding the code inside an object; only allowing other processes to see/access the methods/attributes that the programmer wants them to).