Richard Farrar

Life, Technology and Everything...

  • Home
  • About
    • Musical Interests
      • Tap Thru’ – Band
      • RedStick – Duo
    • PhD Thesis
    • Patent
    • Digital Radio Design
    • Privacy Policy
    • Cookie Policy
    • Terms of Use
  • Podcasts
    • The PlantAdvice Gardening Podcast
  • Podcast Equipment
  • Podcasting Resources  
    • Top Podcast Directories
    • Featured Podcast Widget for WordPress
    • Skype Interview Guidelines for Guests
  • Archives
    • Polls Archive
  • Contact

Plato and Object Oriented Programming

Filed Under: Life, Technology

Plato

Object Oriented Programming represents a paradigm shift away from the traditional modular programming methodologies that have prevailed since the advent of computers. While today’s computer scientists are undoubtedly clever chaps, the intrinsic concepts underpinning Object Oriented Programming were actually considered almost 2,500 years in the dialogues of Plato!

Now, it is extremely doubtful as to whether the architects of Object Orientated Programming (OOP) were aware of these prior concepts, as the stereotypical computer scientist is not normally renowned for his classical education. However, even if they weren’t aware, there does seem to be a remarkable correlation between the thought processes of Plato and the later day software architects, even separated across the millennia.

Ancient Greek Philosophy

Plato was born in Athens, Greece in the year 428 BCE and was tutored by Socrates (often credited as the father of Western philosophy). However, it is Plato, not Socrates, who is arguably the best known of the ancient Greek philosophers (if not of all philosophers), due in large to his profound influence on modern philosophy through his legacy of prolific writings; 35 dialogues and 13 letters.

While Plato’s writings cover many philosophical subjects, it is his radical metaphysical concepts, developed throughout his many dialogues, that are of particular interest in our comparisons with object oriented programming. Fundamentally, it is Plato’s theory of forms that is directly analogous to the foundations of OOP.

Theory of Forms

Throughout his metaphysical discussions, Plato refers to forms as abstract representations that are templates or patterns for real world objects or characteristics of objects.

By way of example, to explain the concept of a form, Plato discusses the concept of beauty. A flower is beautiful and a picture can also be said to be beautiful, but neither are beauty itself. Plato argues that the form  of true beauty exists independently of the objects that have it, as such we may have a notion of perfect beauty, but can never actually experience it first hand.

In Plato’s parlance, a flower is said to partake of the form of beauty. It’s beautiful, but we never see true beauty. The flower is said to be a particular that inherits its qualities from the forms, one of which is beauty.

The form of true beauty is constant and unchanging, whereas a flower may possess beauty for a while, but ultimately looses it when it withers and dies. Being abstract, forms exist independently of the particulars or real world objects that inherit their qualities.

Heavy stuff at the best of times, let alone for over two millennia ago.

Computer Programming

The Traditional Approach

Computer programs are essentially a list of instructions to be followed in a pre described order by a computer; do A, then do B etc.. A bit like following a cooking recipe step by step.

As computers became more advanced, their associated software programmes also became much longer and quite cumbersome. Quite often, a computer would need to run the same bit of code again and again. So, rather than rewrite this bit of code every time it was required, functions or procedures were written as semi-isolated pieces of code that could be called upon whenever they were required. This helped software develop in a modular fashion, with individual modules being responsible for certain computational procedures.

Object Orientated Programming

Object Orientated Programming took modules to the next level, with the modules becoming self contained pieces of code called classes.

A class is a piece of computer program that serves as a template for the creation of an object in exactly the same way that Plato’s forms were abstract philosophical templates for real world objects. The piece of code, or class, is not the object itself, but like the Platonic form, merely a pattern describing what the object will actually be like and what properties it will have when created. Exactly the same concept as Plato’s, just transposed to a different discipline and separated by 2,500 years!

Similar to Plato’s hierarchical system of forms, these classes or templates can be enhanced. Expanded classes can be created, inheriting all the properties of the parent class, but enhancing it with additional properties to create a new “child” class containing all of it’s parents properties, plus a load more of its own:

 1: // Our template or perfect form of a chair
 2: class Chair
 3: {
 4: // bits of code to define the chair goes in here
 5: }
 6:
 7:
 8: // New template for a type of chair inheriting properties from the perfect chair form
 9: class OfficeChair extends Chair
 10: {
 11:     // bits of EXTRA code for the office chair goes in here 
 12: }
 13:
 14:
 15: // Create an actual object, or particular of the office chair
 16: $objMyOfficeChair = new OfficeChair();
 17:
 18: // Create an another object, or particular of the office chair
 19: $objMyOtherOfficeChair = new OfficeChair();

This is an extremely simplified example, but hopefully the concept of classes and objects and their associated analogies to the Platonic forms and particulars can be seen.

Nothing is New

So, whilst we may think that we’re the cleverest generation to walk on the face of this planet, it may be worth pausing a while to reflect an try to gain a little humility, as we may often just be taking a new slant on old ideas.

Even the bible, in Ecclesiastes 1:9-10, recognises this:

Nothing is new under the sun. Even the thing of which we say, “See, this is new!” has already existed in the ages that preceded us.

Great scientists and thinkers of the past have also acknowledged this fact. Even Isaac Newton paid homage to the inspiration of his predecessors:

“If I have seen a little further it is by standing on the shoulders of Giants.”

Seeking Inspiration

If you’re struggling to come up with an answer to an intransigent problem, or want to find a new way of doing things, perhaps you could do worse than brushing up on your classical education in search of inspiration.

By studying history, even in different disciplines to your own, you may come across ideas that could transpose into your own field of expertise and take you in directions that you would never have dreamed of. They even have a name for the process, they call it the cross fertilisation of ideas.

So, next time you’re a little stuck with a problem, where will you turn to for your inspiration? Plato, Aristotle…

Posted on 31 January 2010Tagged: oop, philosophy, programming, software

Share this Page!

  • Tweet
  • RSSRSS Feed

Comments

  1. Benjamin commented

    31 Jan 10 at 8:22 pm

    Thanks for the article. I like the comparison between Plato’s philosophical concepts and OOP and I think you do a good job for an introduction to object-oriented programming. However, if I were to attribute OOP concepts to a philosopher I would choose Plato’s student Aristotle for his ideas of the universal (classes) and particulars (objects) and for his classification of living things.

    Reply
    • Richard commented

      01 Feb 10 at 1:50 pm

      Thanks Benjamin. It was quite difficult to get such concepts over in a short article. Regarding Plato vs Aristotle, you could argue that the outline ideas were proposed by Plato and then expanded by Aristotle. Either way, it was a very long time ago.

      Reply
  2. Autism App commented

    09 Apr 11 at 3:34 am

    I really love programming. but i think it is a quit hard to learn.

    Reply
  3. bilgisayar servisi commented

    25 Apr 11 at 6:21 pm

    That’s a mold-beraekr. Great thinking!

    Reply
  4. Antagonist commented

    07 Mar 12 at 3:29 pm

    Awesome ,
    Couple of weeks before I started going to classes for OOP , I was reading about Plato and his theory of forms.
    And right before , there where lot’s of people saying that OOP is not that easy to understand , and most of them sad I wont be able to understand (Just because they did’t).
    And while I was in the middle of the class , I though to my self , ( isn’t this the same shit I was reading days before ? )
    And there it was , one very simple and yet so powerful and elegant concept of OOP.

    Reply
    • Richard Farrar commented

      07 Mar 12 at 3:33 pm

      Very true, although I’m sure most computer programmers aren’t aware of the connection.

      Reply
      • Antagonist commented

        07 Mar 12 at 3:39 pm

        yes , I though I’m the only one that have spotted the connection , until I saw this post.
        And I’ve been talking with a lot of colleges , and the result always is NO ONE knows that.
        And the reason is quite obvious , programmers don’t give a shit about philosophy and vice versa (most of the time).

        Reply
        • Richard Farrar commented

          07 Mar 12 at 3:42 pm

          Indeed, programmers are not typically well read in the classics 🙂

          Reply
  5. Structured Programmer commented

    30 Aug 12 at 3:58 pm

    Godamn Plato! What have you done?

    Reply
  6. Blaize commented

    07 Aug 14 at 1:55 am

    Does this apply to class-less languages like JavaScript? I suppose Aristotle’s rebuttal to Plato would more aptly describe these types of languages because every instance of a form has to be a particular to exist, and behold, the prototypical language with first class functions was born…

    Reply
    • Richard Farrar commented

      07 Aug 14 at 12:48 pm

      Having a degree in Computer Science and another in Philosophy I suppose you’re ideally placed to appreciate the Platonic link with OOP 🙂

      Reply
  7. Khaled Badeechi commented

    19 Sep 16 at 4:30 am

    Hi Richard,
    Few weeks ago i was reading about Plato’s Theory of Forms, and the idea of this article came to my mind.
    I was so fascinated by the link between OOP and Plato’s Theory that i wanted to write an article about it.
    While doing my research i saw this article, and it really shocked me how you have written exactly what i was planning to write !
    I would be very happy to contact with you. Maybe we have more shared ideas that we can exchange, and who knows, maybe we can work together on larger projects 🙂

    Reply
    • Richard Farrar commented

      25 Sep 16 at 5:09 pm

      Hi Khaled,

      Thanks very much for stopping by my website and taking the time to leave a comment. Great minds think a like 🙂 It would be good to connect; what sort of stuff do you work on?

      Reply
  8. Katya Sorok commented

    15 May 18 at 2:51 am

    I found this article because of google search if anyone already wrote about the connection between OOP and Plato and Aristotle. I am new to programming and learning JavaScript right now. Today I saw that every time you create an object the prototype for object is there and some properties and methods are already available. I immediately thought of Plato and Aristotle and actually thought that it is where computer science took the idea from)))).

    Reply
    • Richard Farrar commented

      15 May 18 at 12:42 pm

      Thanks Katya, I see you made the connection too, although I’m not certain if OOP actually drew on the ideas of the ancient philosophers, but it’s certainly an interesting point.

      Good luck with your adventures in programming.

      P.S. I like the artwork you have on your blog!

      Reply
  9. TR Amat commented

    26 Apr 20 at 11:17 am

    I recently came across this article when someone asked about whether Platonic Idealism as connected to OO programming. Nice summary.

    I was interested in the follow-up question of what programming practices would result from looking at more modern philosophers, like Wittgenstein, who was in many ways totally opposed to Idealism…

    Reply
    • Richard Farrar commented

      29 Apr 20 at 5:32 pm

      Hi,

      Thanks for comment.

      I’m afraid I’m not familiar with Wittgenstein and his philosophies, but it’s always interesting to look into these sort of things, particularly with such a plethora of new languages. Perhaps time for another one exploring a different paradigm? 🙂

      Reply
  10. npv commented

    27 Nov 20 at 6:12 pm

    I am a computer engineer that got interested in western philosophy as a reacquainted myself with the seminal work in the field, i quickly realized Plato was providing an early look at some basic OOP concepts. A quick internet search and you realize others had the same idea, fascinating,

    Reply
    • Richard Farrar commented

      30 Nov 20 at 1:38 pm

      The similarity is a bit spooky isn’t it, and that was written over 2,000 years ago!

      Reply
  11. Murat commented

    20 Oct 21 at 8:45 pm

    Thank you very much for sharing this with us.

    I usually find myself digging into the hierarchy between Human and Presence/Being classes step by step. I can’t think of a parent class for Presence/Being but even I touch that “wall” of mine, it is so relieving and scary at the same time.

    Can an object know anything about its class? Can we?

    Reply
    • Richard Farrar commented

      22 Oct 21 at 1:29 pm

      Hi Murat,

      Thanks very much for your comment.

      It is a very interesting philosophical topic. When you’re alluding to an object, ergo us, knowing about its class, I think you might be trying to penetrate the “veil of perception” as I believe they refer to it. Theologically you could perhaps say that’s the age old question of trying to know God; perhaps two sides of the same coin?

      Reply
  12. Abdullah commented

    07 Jan 23 at 8:12 pm

    Thank you Richard for keeping this alive , I always thought that human being are trying to mimic something , perhaps going back to something . OOP , instant knowledge , AI etc
    Philosophers got the abstract that applied sciences will mimic one day . That’s why they knew that their knowledge is the knowledge and although it’s taking science (applied sciences) a long time but we are going there one day

    And as APV and others commented I also always had this kind of thoughts and luckily your article was among the first results !

    Reply
    • Richard Farrar commented

      08 Jan 23 at 7:10 pm

      Hi Abdullah, Thanks very much for your comment and thoughts on the subject too.

      Reply

Trackbacks

  1. XIII.3 Name Oriented Software Development « Conflated Automatons says:
    24 Mar 11 at 1:52 pm

    […] of Object Oriented design is that it is reheated Platonism. See, e.g., blogs by Vlad Tarko and Richard Farrar. ((Should the frequent light analogical treatment of Platonism and software sound a note of alarm […]

    Reply
  2. Wait… Plato Was A Coder? (who’s play-dough anyway?) | Plato-Was-A-Coder says:
    13 Aug 15 at 11:24 pm

    […] – I learned this all from this guy: Richard Farrars Blog […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

BBC Radio Interview on Podcasting

Listen to my interview on BBC radio about podcasting and how long a podcast should be:

https://www.richardfarrar.com/audio/BBC-interview.mp3

Topics

  • Blogging
  • Life
  • Podcasting
  • Technology
  • Web Technology

About Me

Richard Farrar

Hi, I'm Richard; an Electronic Engineer by trade, self confessed Geek, Blogger and Podcaster, although as often the case life has the habit of taking us on unplanned journeys... Read More ›

Popular Posts

  • Embedding Album Art in MP3 Files
  • How to Check if your Speakers are Wired Correctly
  • Song Capacity Calculator for MP3 Players
  • What is Joint Stereo?
  • What are ID3 Tags in MP3 Files?

Find Me Online

  • Twitter
  • YouTube
  • RSS Feed

Copyright © 2023
All details subject to change without notice. E&OE. All rights reserved.