Geek Stuff

Platonic Programming

No, this has nothing to do with friends working on shared code. Recently I read a book that, among other things, touched on philosophy, something I hadn’t spent much time reading since college. The book led me to do a little more refresher reading on Greek philosophy, especially Plato and his concept of Forms. At the same time, I’ve been working at refreshing my software development side, something that’s been largely set aside the past several years while I focused on database administration. At the moment, that means lots of reading on Java and object-oriented design. One of the key concepts in Object-Oriented Programming (OOP) is the class. A class is an abstract collection of variable definitions (things) and method definitions (processes). It never actually exists in a program or system, except as a definition. It’s a model. Everything that it can know about or do is contained within the variable and method definitions it contains. So if it never exists, how is it used? Through instantiation. Instantiation is the software process of creating an instance, a real-world entity, from a class definition. The program or system interacts with the instance. The instance doesn’t have to be an exact duplicate of the class; it can add variables or methods, or override variables or methods existing within the class. And other things, which I won’t bother with here. A class can instantiate multiple objects within a program or system. But the program or system only knows about the variables and methods within that instantiated object as long as the object exists, and the object only knows about the system while it exists.

I don’t know if the developers of OOP read Plato, but it is an intriguing question. Plato developed the concept of Forms, which were abstract entities in another plane of existence, perfect and unchanging. What we see in the world around us – people, trees, earth, sky – are only copies of the corresponding Forms. Not exact copies, and not imperfect and unchanging, for the representations of Forms here change. People age, trees lose leaves and drop limbs. But the Form that is represented never changes. We have some knowledge of the perfect Form, which couldn’t have come from anything in our experience in the physical world; Plato explained that by saying our souls, which existed before our bodies, had been acquainted with the Forms on that other plane, and held on to a vague recollection. Sort of the way a program has “knowledge” of the class, through its definition, but only in an indirect way, that has no tangible benefit, until the Form “instantiates” itself into this world. So did Plato’s Forms play a philosophical role in the development of OOP? Object-oriented programming was developed in the early 1960s, by Ivan Sutherland in 1963 according to some, by Ole-Johan Dahl and Kristen Nygaard in 1965 according to others. I have no idea if any of these men ever read Plato, but it’s entirely likely that at some point they encountered his writings at some level. But I’d be willing to bet that Plato would have no problem understanding the concept of object-oriented programming.

3 thoughts on “Platonic Programming

  1. I found your site today! Great!

    I have an online magazine, Dew on the Kudzu, with multiple contributors. You can check it out thru the web address up top there.

    I would like to put your post, May 17, 2005
    Tips On Growing Kudzu, in the magazine.

    Please go check it out and send me an email letting me know if I can use your post – with full credit of course!

  2. Shouldn’t “Not exact copies, and not imperfect and unchanging” read “Not exact copies, and not *perfect* and unchanging”? Good post. Those darn Greeks had it goin’ on.

Comments are closed.