Object-oriented programming

Edit on Github instead

Object-oriented programming is an attempt to make the structure of computer programs more understandable to people (like you!) by encouraging programmers (also like you!) to write programs that mimic the real world.

The base of object-oriented programming is that everything is an object.

Objects are the "things" around us. Some – computers, tables, chairs, cars, T-shirts, on and on – are tangible, and others – a meeting, a date, a list of tasks to be completed – are conceptual.

When programming, you get to set up the objects. That means you can make a blue (attribute) car (object) that flies (procedure) if you want.

Any piece of software, from Google search to your Netflix movie queue, can be broken down into objects. For example: imagine the object that controls Google's search algoirthm can send a message to google.com when it needs user information; imagine the search algorithm calling out, "Hey search box! Send me what the user typed in so I can search for it!" Once the search box responds, the algorithm can go ask its index object – the list of all the websites it knows – what it found.

As you design programs, sometimes you'll find it helpful to mimic real-world objects; other times, conceptual objects that don't exist in the real world will better suit. That's normal. Objects and object-oriented programming is one tool you can use to solve (programming) problems, but it need not be your only tool.

Suggest changes

Related links

URL Topic Source