Content-Type: text/html Wikipedia: Object-oriented

[Home]Object-oriented

HomePage | RecentChanges | Preferences
You can edit this page right now! It's a free, community project

An object-oriented programming language (as opposed to a [procedural programming language]?) encourages the programmer to think of his program in terms of primarily the data and the operations on that data. Procedural languages encourage the programmer to think in terms of functions that get passed variables.

The world's first object-oriented language was Simula?. The SIMULA programming language was designed and built by Ole-Johan Dahl and Kristen Nygaard at the Norwegian Computing Centre (NCC) in Oslo between 1962 and 1967. The language has been highly influential on modern programming methodology. Among other things, SIMULA introduced important object-oriented programming concepts like classes and objects, inheritance, and dynamic binding. More information can be found [here].

For a simplistic example, lets say you wanted to program a computer to open a door when the user types "open" and close the door when the user types anything else.

In a procedural language you might write:

function main()
{
  a = getinput()
  if a = "open" then call open_the_door
  else
  call close_the_door
}

In a object oriented programming language you might do the following:

class door {
  function open();
  function close();
  function process_request(user a) {
    if a.request()="open"
        then self.open();
        else self.close();
  }
}

Object oriented programming languages include:


HomePage | RecentChanges | Preferences
You can edit this page right now! It's a free, community project
Edit text of this page | View other revisions
Last edited August 5, 2001 7:22 pm (diff)
Search: